Getting jointsPerVertex from AWD file

Software: Prefab3D

Thomas Weiss, Jr. Member
Posted: 14 March 2013 07:22 AM   Total Posts: 35

Hi there,

This isn’t really a support request but rather some curiosity about how Prefab3D loads models!

When loading an AWD file that contains a skeleton animation, we need to create an instance of SkeletonAnimationSet with a jointsPerVertex parameter that matches the model’s animation… so how does Prefab3D retrieve this parameter and instantiate the class correctly?

Thanks a lot
Thomas

   

Avatar
80prozent, Sr. Member
Posted: 15 March 2013 04:53 PM   Total Posts: 430   [ # 1 ]

Hi Thomas

I dont know how prefab does this, but for away3d you can just modify the “AWD2Parser.as”.

Inside of the “AWD2Parser.as” at line 810 you find this code:

// Ignore sub-mesh attributes for now
    
parseUserAttributes();
    
sub_geoms constructSubGeometries(vertsindicesuvsnormalsnullweightsw_indices);
    for (
i=0i<sub_geoms.lengthi++) {
     geom
.addSubGeometry(sub_geoms[i]);
     
// TODO: Somehow map in-sub to out-sub indices to enable look-up
     // when creating meshes (and their material assignments.)
    


just add this trace-output on top of it, to trace out the Joints-Per-Verticle

trace("Joints per verticle = "+(weights.length/(verts.length/3))) 

Hope that helps

 

 Signature 

sorry…i hope my actionscript is better than my english…

   

Thomas Weiss, Jr. Member
Posted: 16 March 2013 05:11 AM   Total Posts: 35   [ # 2 ]

Wow, perfect answer, thanks a lot!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X