Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Object meshes

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Dec 2017 23:33
The are a few commands that refer to an object containing a number of meshes.

How do i create a model and define different meshes in my 3D proggy

I've tried making them groups in Ultimate Unwrap but that doesn't seem to work

Are meshes created programmatically or am i missing something with my 3D proggy?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Dec 2017 00:48 Edited at: 13th Dec 2017 01:33
Not sure the 3d modeling program you are using, but I just used FragMOTION to test creating multiple meshes and it was easy.

I opened an animated FPSC model and it had 1 mesh.

The I duplicated the mesh to create a second one (could have been any created mesh though but duplicating was easy)

Then I created a new bone that was not attached to the old ones.

Then I assigned the new mesh to the new bone and exported as an X file.

Loaded it in AppGameKit and did a GetObjectNumMeshes( objID ) and it returned 2 for the number of meshes.

It goes back to that other thread about meshes today, it is all about the bones and their assignments.

If you have multiple bone sets, then you will have multiple meshes as long as they have been assigned to the bones.

EDIT
I guess I may be wrong about the bones after all.

I just tried again and opened another character from FPSC.

This time I just duplicated the meshes group of vertices/faces then exported the X file with out adding any more bones or assigning the new mesh to a bone.

Loaded it in AppGameKit and did the GetObjectNumMeshes( objID ) and it returned 2 for the number of meshes.

So, it seems FragMOTION has no problem creating models with multiple meshes for AppGameKit objects.

EDIT
Okay, this is strange, because I tried it again from scratch.

This time I created a couple meshes, then bones, then assigned them, and exported.

It seems that when I create a model from scratch, it only recognizes 1 mesh even when I duplicate like before.

Yet, adding to a loaded model then adding and exporting it recognizes it.

So, there is something in the schema that is different, and I bet it is something simple we are overlooking.

I'll keep trying to figure it out until someone comes in and tells us what we are doing wrong.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2017 02:06
Ok i see where it can export meshes for .x files. I was hoping it would support meshes for .obj files.
Thanks for the help
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Dec 2017 02:16 Edited at: 13th Dec 2017 02:44
I am still trying to figure out what I am doing wrong when starting from scratch.

Now I have loaded an FPSC model then created a box and a sphere, and exported it as an X file.

Loaded it in AppGameKit and checked the number of meshes and it was one.

Then I opened it back up, added a bone, assigned the sphere to the bone, then exported.

This time is came back as two meshes.

I'll try starting from scratch again and play with it until I figure out what I am doing wrong.

Glad you got yours sorted though.

EDIT
The group has a property called ParentNode, and I have to put the Bone name in that field, then it works even from scratch.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2017 06:12
I have noticed that UU doesn't export meshes as i would expect. I exported something that should have had about 10-12 meshes and i AppGameKit it is only 3
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Dec 2017 08:20
Quote: "I have noticed that UU doesn't export meshes as i would expect. I exported something that should have had about 10-12 meshes and i AppGameKit it is only 3"

I had only tested up to 3 earlier, but I just tested a 4th and it worked fine, so I'm not sure what the limit is for AppGameKit but it is definitely not 3.

I have always used single meshes/textures up until now, but I might start playing with these a little bit.

It would be nice if I can add this to the Model Viewer when I add those other texture features requested.

Not sure when that will be though, as I am now hopping back and forth between the Pirates and Steganography.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Dec 2017 15:48
In Fragmotion to get a object to have more than 1 mesh just select the parts of the mesh and add them to a new group.
Then when you export to .x just check the box that says export groups. This will separate them to limbs in the .x file
and when loaded into AGK. If you want one mesh just remove all groups before export in Fragmotion. Bones are not involved.
I asked the author of Fragmotion to add this to the .x export so it would create limbs for the object.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Dec 2017 19:10
Quote: "In Fragmotion to get a object to have more than 1 mesh just select the parts of the mesh and add them to a new group.
Then when you export to .x just check the box that says export groups. This will separate them to limbs in the .x file
and when loaded into AGK. If you want one mesh just remove all groups before export in Fragmotion. Bones are not involved.
I asked the author of Fragmotion to add this to the .x export so it would create limbs for the object."

Thanks for the info.

I guess I was getting lucky/unlucky with my trial and error attempts.

Quote: "If you want one mesh just remove all groups before export in Fragmotion. "

You mean combine the groups into one group, right?

Deleting them would delete the mesh, right? (once the group is selected)

Quote: "Then when you export to .x just check the box that says export groups. "

Either I overlooked that, or it wasn't there. (I am using an older version)

I will take another look later.

Thanks again

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Dec 2017 20:16
I am using Fragmotion 1.3.4 it was added a few versions back.
You can actually delete all the groups without deleting the mesh it will combine
all the meshes.
The coffee is lovely dark and deep,and I have code to write before I sleep.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2017 21:07
Is the syntax for a mesh in a .x file frame{...}?
See attached .x file. I load the object and it returns only 1 mesh

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 13th Dec 2017 23:34
I opened your file in Fragmotion it shows all the different groups.
I exported it as .x with the export groups checked, try this file.
You can open it in note pad to compare.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 13th Dec 2017 23:54 Edited at: 13th Dec 2017 23:57
Quote: "I am using Fragmotion 1.3.4 it was added a few versions back."

I'm running 1.2.6, and I double checked and it is not a tick option for me when exporting X files. (have a 'Hierarchical Mesh' tick)

I guess it's time for me to download the latest version.

Quote: "I asked the author of Fragmotion to add this to the .x export so it would create limbs for the object."

Yeah, he is a cool dude.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2017 23:59
I opened your .x file and GetObjectNumMeshes() returns 1
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 14th Dec 2017 01:06 Edited at: 14th Dec 2017 01:35
Quote: "I opened your .x file and GetObjectNumMeshes() returns 1"

I opened his in AppGameKit and it showed 24 meshes.

Did you put the right object ID in there ? .... GetObjectNumMeshes( objectID )

The one I opened/exported shows 24 meshes too...

All I did for this one was to Open yours in FragMOTION 1.2.6, then Exported it as an X file.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2017 01:39 Edited at: 14th Dec 2017 02:32
I don't think i have installed the very latest version. The one just the other day

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2017 02:33
You need to use the LoadObjectWithChildren() command.

https://www.appgamekit.com/documentation/Reference/3D/LoadObjectWithChildren.htm
The coffee is lovely dark and deep,and I have code to write before I sleep.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 14th Dec 2017 02:40 Edited at: 14th Dec 2017 02:42
Ok that works fine with your model but not with mine (out of UU). I'll investigate the differences

One other question;
It appears to me that AppGameKit is flipping the Z axis of models (.obj). Is that correct?

Login to post a reply

Server time is: 2024-11-24 05:45:08
Your offset time is: 2024-11-24 05:45:08