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.

DarkBASIC Professional Discussion / animated x object from 3dc not working animations wont play

Author
Message
suhrim
18
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 20th Dec 2010 21:14
i have a character that i made and animated in 3d canvas pro using bones when i export it as a .x the animations wont play.

the code i'm trying to use is :


load object "player.x",32
phy make box character controller 32, -400.642,-63.28,-800, 0.50, 0.56, 0.12, 1, 0.5, 45.0

do

key = 0

if upkey ( )
key = 1
phy move character controller 32, 150.0
Loop Object 32,2,11: Set Object Speed 32, 10000
endif

if downkey ( )
key = 1
phy move character controller 32, -150.0
Loop Object 32,2,11: Set Object Speed 32, 10000
endif

if key = 0
phy move character controller 32, 0.2
phy move character controller 32, -0.2
Loop Object 32,12,20: Set Object Speed 32, 10000
endif

phy update
sync
loop

my question is, is it the modle or the code and if its the code how would i fix it.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 20th Dec 2010 22:18
It could be both but most likely with the code because I see and error.
Loop Object will reset the model's frame to it's beginning each time it is called and then play the animation. Since you call it every loop, your only setting it to the first frame each time not actually playing the animation. You need to check if the animation is already playing before calling up the command so do this instead.

Also for future reference, use the
"code" button by highlighting the code and clicking the button.

My computer surpasses all the technologies of the day. What computer do I have?

suhrim
18
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 22nd Dec 2010 06:52
thanks but that didn't work. i'm going to try and see if its the model or maybe its the fact i'm making the object in 3d canvas v7.1.1.2, i seen in the forum that other people were having trouble
with animated objects exported from 3d canvas but have not seen any solutions yet, but if you have any other ideas they would be greatly helpful. thanks again for trying.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 22nd Dec 2010 16:34
You can do a check in dbpro if the object actually even has animation frames by using. That way you can see if it's 3d canvas or dbpro.


My computer surpasses all the technologies of the day. What computer do I have?

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Dec 2010 17:37
From the code above you will never see it animate it is looping continously as mad scientist pointed out.
Why not try simply

If it animates ok then the anim is working.

http://s6.bitefight.org/c.php?uid=103081
suhrim
18
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 22nd Dec 2010 18:38
Madscientist thanks it read that there are 40 frames but the object still does not animate and for the other 2 ideas they did not work,
what i'm trying to do is make it play the walk animation when i hit upkey or downkey and the idle animation when the player is standing still but thanks for trying
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 22nd Dec 2010 19:44
Try this instead of looping it.


My computer surpasses all the technologies of the day. What computer do I have?

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Dec 2010 19:57
Simply playing the object in a small test prog doesn't work? If it doesn't then the object has to have a problem. I am not sure how my example wouldn't work unless you copied it literally without looking at it. I gave 2 examples in the code snippet, if you pasted the lot into db and ran it wouldn't work of course. I was only saying do a little test prog without your other code, to verify if the object is working and it isn't just your code above causing a problem.

http://s6.bitefight.org/c.php?uid=103081
suhrim
18
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 22nd Dec 2010 21:11
ok i found out when i export the object using the drop down file menu it read 0 frames, but loads the object fine just with no animations,
and if i export it using the right-click drop down it reads forty frames shows that the frames are playing but i don't see the object. i am making the object in 3d canvas pro 7.1.1.2

and i did make a test program
any ideas here is the test program
[sync on
sync rate 0
autocam on
hide mouse

load object "player.x",32
loop object 32


do

Text 0,0,str$(Total Object Frames(32))
text 0,10,str$ (object frame (32))

sync
loop
]
suhrim
18
Years of Service
User Offline
Joined: 15th Jan 2008
Location:
Posted: 23rd Dec 2010 10:25
just wanted to say thanks for the help it was the model and i fixed it, animations and object both show up now and you were right about
the loop object command it holds the object at one frame if its in the main loop, so now i will move forward and try to fix my code.
thanks again by the way how i fixed it was i selected the object group and enabled a ik joint for the character's mesh then exported for anyone that wanted to know and my model was fixed.

Login to post a reply

Server time is: 2026-07-21 20:35:19
Your offset time is: 2026-07-21 20:35:19