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 / Animated .X file not texturing

Author
Message
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 12th Aug 2016 15:21
Hi all,

I've gone through a few posts about this and everyone else seems to have found solutions that worked, but none of them want to work for me. I'm starting to think perhaps something is wrong with my file?

I have an animated .X file of a butterfly, and a matching texture to go with it. The 3D object is made of 3 child objects and the texture goes the same on all three objects.

Here's the code I'm using to create it in-game, but it's just not working... Any ideas on what I'm doing wrong here?

Some things to note:

- The filename is correct (yes, correct case, too, and I checked for PrettyText)
- The .X file has been exported as a text format
- I've set the image wrap, but really it's not needed as the object has been correctly unwrapped. I put it in there anyway is it also doesn't work without those lines.
- If I don't use LoadObjectWithChildren and just load it in using LoadObject (and thus not have any animation) then it textures just fine using the standard SetObjectImage command. It only breaks when I try and get the animation working.



Any help would be very much appreciated!

Attachments

Login to view attachments
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 16th Aug 2016 01:50
Has anyone got any ideas on this? It's genuinely holding up my development quite badly, not being able to texture my animated models...
Green7
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 16th Aug 2016 08:40 Edited at: 16th Aug 2016 08:41
-Do you need to load the texture and lay it on the meshes? Is it not already textured and ready? Sorry if i ask, I did not work with x models in AppGameKit until now, but often in DBPro.
-If you maybe texture the 3 child objects with a separate texture? Each part with its own?
-The texturing is not animated? Maybe you only textured the very first frame. Sounds strange, i know. In Max you can set new textures in every frame, so maybe...
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: 16th Aug 2016 15:50
In the future run in debug mode it tells you what is wrong.
Mesh numbers start at 1 not zero, this info is in the help files.
It jumps out of the for loop because SetObjectMeshImage fails the first loop.
Also 31840 frames of animation is ridiculous cut down the animation
to about 20 key frames of animation.

The coffee is lovely dark and deep,and I have code to write before I sleep.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Aug 2016 00:20 Edited at: 17th Aug 2016 00:21
@Green7
I actually initially tried setting the texturing up in 3ds Max and letting it auto-texture but it wouldn't work, either as soon as I brought it in as an animated model.

@Stab in the Dark software
- Debug mode threw no errors or info whatsoever.
- Starting the mesh at 1 didn't change anything. Still won't texture.
- The animation only has 200 frames, but for some reason it reads in as 31840 in AGK

I've actually attached my object and texture in the original post so you can see all of this for yourself.
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: 17th Aug 2016 01:48
AGK does not auto texture like DBPro.
Quote: "Debug mode threw no errors or info whatsoever."

I get the error Failed to set mesh image for object 100001 mesh 0 - mesh index is out of range in main.agc at line 23
When I change it to 1 it is textured.
I opened the model in Fragmotion and it has 31840 frames of animation.

The coffee is lovely dark and deep,and I have code to write before I sleep.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Aug 2016 02:23
Oddly enough, none of that data comes up in my debug output when I do it. Other messages for other discrepancies come up, but nothing related to the animated model.

Also, I've changed the code to start at Mesh Index 1 and it makes no difference.

The framecount must change during the X export. In 3ds Max it uses 200 frames.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Aug 2016 02:25
Put it this way... Are you able to take the .X file and the .PNG file and load it in animated and textured into an app?

If not, it may simply be some sort of export setting which AGK2 doesn't like.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Aug 2016 04:24 Edited at: 17th Aug 2016 04:25
It seems as though I can have an animated model OR a textured model. I can't manage to produce both...

As an update, I have tried several other formats now including 3DS and DAE (both of which output more accurate frame information at 200 frames) however the same thing happens. If I texture it, it won't animate. If I animate, it won't texture.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 18th Aug 2016 02:00
There is an example of an animated .x file in the agk projects/3D/BoneAnimation folder. Maybe that will help
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: 18th Aug 2016 02:05
Works for me?
The coffee is lovely dark and deep,and I have code to write before I sleep.
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Aug 2016 02:47 Edited at: 18th Aug 2016 02:54
My model or the example?

Are you saying you used my model and my code and it worked? Both textured AND animated?
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: 18th Aug 2016 14:34 Edited at: 18th Aug 2016 14:38
Sorry, just realized the model I got to work was yours after I ran it thru Fragmotion.
You must be exporting it incorrectly from 3Dsmax. I do not use 3Dsmax so I can not help there.
When I opened your model in Fragmotion It was offset from origin so I centered it.
I did not have time to reduce the animation but it animates and is textured.
I have attached the model.

Code I used.



P.S. Not to long ago I worked with the author of Fragmotion to get it to correctly export the X format
so it worked correctly with DBPro and AGK2.
The coffee is lovely dark and deep,and I have code to write before I sleep.

Attachments

Login to view attachments
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Aug 2016 15:04
Sounds like a plan, then! The evidence had been mounting more and more that it was an export problem, so I'll definitely give FragMotion a shot. Sounds like a winner!
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Aug 2016 15:15
Wow, it for real makes you type the lord's prayer in order to make the program run?
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: 18th Aug 2016 15:22
I purchased Fragmotion because it is such powerful software.
Once you become familiar with it you will be amazed what it can do.

For example here is a link to videos I made on using Fragmotion.

https://forum.thegamecreators.com/thread/216652
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: 18th Aug 2016 22:58
Question for Stab dude about fragmotion: Does fragmotion allow you to actually Add bones?
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 18th Aug 2016 23:47 Edited at: 19th Aug 2016 00:47
Quote: "Question for Stab dude about fragmotion: Does fragmotion allow you to actually Add bones?"


Okay, I am not the Stab dude, but I can answer that question.

Yes, FragMOTION is a full featured modelling program.

Vertices, faces, groups, bones, animation, texturing, the works.

It does it all, and the developer has always been helpful to The Game Creators community.

It is what I use, and I highly recommend it.

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: 19th Aug 2016 01:25
thanks. conjured dude
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 19th Aug 2016 02:38 Edited at: 19th Aug 2016 02:40
hope it helps

Here is a peek at my P51 Mustang that I made from scratch with FragMOTION.

I just animated the propeller today (using FragMOTION), and worked on in game controls for AGK.

The video was made with FRAPS, so it is a bit choppy, and my internet connection sucks so I have to use a lower picture quality than desired, but it looks pretty good in AGK...




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: 19th Aug 2016 03:45
neat

Login to post a reply

Server time is: 2024-11-17 10:12:15
Your offset time is: 2024-11-17 10:12:15