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 / LoadObjectWithChildren not working on mobile? Or .3ds files not good with mobile?

Author
Message
pseudohaiku
8
Years of Service
User Offline
Joined: 9th Mar 2016
Location:
Posted: 14th Dec 2016 05:47
Hey guys,

So I'm basically going like..

LoadObjectWithChildren ( 1, "object.3ds" )

The file has a single 3D box in it that has keyframe animations applied. When I used GetObjectChildID, it returns a value of 100001, and I can use this to texture THAT object with SetObjectImage ( 100001, 1, 0 ) for example.

I'm using other functions, like SetObjectAnimationSpeed, which I set to the "parent" object, like SetObjectAnimationSpeed ( 1, 10.0 )

This setup works totally fine me on PC. When I use GetObjectNumChildren ( 1 ) it returns 1 (since it's the only object in the 3ds Max scene), if I add more objects there, that will increase.

So all good, until I go to load it up on mobile, and then I get the error "Failed to set animation speed for object 1 - object is not set up for animation, use LoadObjectWithChildren.."

Weird, because I'm already using LoadObjectWithChildren..

If I then comment out //SetObjectAnimationSpeed and //SetObjectImage - it will then at least not crash, however no objects are visible. When I query GetObjectExists(1) it says it exists, but now GetObjectNumChildren(1) will return 0.

Again, if I run it on PC it works totally fine no problems. I just can't seem to figure out what's wrong for mobile.

I've tried to call Sync() straight after LoadObjectWithChildren to try and update the scene, to no avail. Sometimes the scene will work randomly and it'll load the object, but promptly crash when I try to do anything else before not working at all when I re-run it. Not sure what that's about.

Is the .3ds format sketch-y with mobile? I've got other static objects in the world scene that just don't show on mobile either even when I get rid of the animated object. Again it runs fine on PC.

Any ideas?
pseudohaiku
8
Years of Service
User Offline
Joined: 9th Mar 2016
Location:
Posted: 14th Dec 2016 07:51
I've been trying to use .X exporters which seems to be resolving these problems but they're all so sketchy with animation exporting!
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 14th Dec 2016 10:47 Edited at: 14th Dec 2016 10:48
Last time i use max, i used KW Exporter. If u r currently not using this u should give this a try.

Now im on blender, i have no problem with bones animation when use together with Ultimate Unwrap(.dae and .x work well) but as i said in ur thread, keyframe animation in blender dont work in AGK(e.g scaling animation )
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 18th Dec 2016 18:09
The error "Failed to set animation speed for object 1 - object is not set up for animation, use LoadObjectWithChildren.." comes up for me on lightwave loaded scenes for just about anything.

Sometimes it comes up if there's no pivot key(s)
There were some preview settings left in the scene file (removed by hand in text editor)
Pathing was broken (In your case, hard coded paths like e:\mydata\blah.png will fail) when deploying to another device for obvious reasons! Lightwave always fails because it uses e: mydata blah.lwo or some similar filenames. In which case, I have to hand strip the e: mydata and just rely on relational paths.
You may even need to consider case sensitivity in file names and references when porting to mobile

Have you tried waiting after loading the scene? Maybe when the scene is loaded and the loading of the objects is perhaps asynchronous and is too slow sometimes? This sort of thing could account for working apparently randomly?

Login to post a reply

Server time is: 2024-04-25 14:25:43
Your offset time is: 2024-04-25 14:25:43