Keyframe-based animation

Started by VT900, December 27, 2010, 03:39:18 PM

Previous topic - Next topic

VT900

Hi,

I have a blender model that I animated and exported as seperate objs for each keyframe. Basically all the animation is, is a few things rotating about pivots and I had to check an option in the blender exporter which said "Apply Modifiers" or the keyframes would not carry the rotation information.

Now, that works well, I load each keyframe in an animation object and set the animation to my Object3D, and animate it each frame using obj.animate(index, 2);, etc. That works fine.

What I have done now is create a new object that is meant to surround the first object to a degree. I have basically taken that first model, extruded some sides and deleted the parts I did not extrude. I then exported that as an obj and loaded it in, and is displays fine.

However, I now need it to "latch on" to the first object, so that it rotates simulateously with the first object each keyframe. I could animate the second object manually in blender, but I may not get the rotation angles exactly right and also it will be really tedious to do this. I was thinking of using some better solution in code.

Any ideas?

fireside

Maybe a picture would help.  If it's an animation, I don't think you can do much about it, so you might want to rotate the whole thing with code, though.  You should be able to sync two animations pretty easily, also. 
click here->Fireside 7 Games<-

VT900

Yeah, I'm not too sure on how to rotate the separate parts in code though, and it would probably be best to somehow get the rotation angles from the first object and apply them in the same areas in the second object, since the second object is based on the first object but with a few sides extruded.

fireside

What about just making them one object and exporting them that way?
click here->Fireside 7 Games<-

VT900

Well, I need to swap the second object around - the user chooses which file the second object will be loaded from, so I need to keep the objects separate. So exporting the objects as one would be a disadvantage.

fireside

Rotating in code shouldn't be that hard.  You can get the axis of the part and then rotate it around that axis.  I haven't done it, though.
click here->Fireside 7 Games<-

VT900

How would I go about doing that? The objects are loaded in as obj models currently. How would I select the part that is meant to rotate? Do I have to export each separate part as a different object or is there a better solution?

fireside

I would think you would need to separate the object that rotates and make that a different object and then do parenting to keep them all together.
click here->Fireside 7 Games<-

VT900

I did this quickly and now get a warning:

WARNING: This OBJ-file contains n-polygons with n>4! These polygons wont be displayed correctly!

The actual model displays fine though, so I guess I left in a few polygons I shouldn't have. Any ideas on how to correct this in the obj file? I used a separate obj editor to separate the parts of the model. Is there some command line tool that will fix this? Other than that it works fine now.

fireside

#9
I don't know of any command line tool.  I know in blender you can press control_t on a selected model when in edit mode and all the selected poly's will be triangulated.  
click here->Fireside 7 Games<-