Bones affecting a point object
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/07/2005 at 17:13, xxxxxxxx wrote:
Hello again,
This time I'm creating a plugin (for a friend) that exports every frame of animation (from the project's min to max) as a separate .obj. Each animated document is composed of a pointObject (a plain old mesh) with a bunch of bones and restriction tags. To export the vertices at each frame with the proper bone rotations applied (I currently use GetMg() from the object and that of course doesn't give me anything other then the 'base' pose) it appears if I have to looked each bone in the document, determine which vertices it's restricted to, then figure out the proper order to multiply the bones against the vertex to get the final vertex, that sounds rather daunting to me. I was curious if there was a quicker and easier way to determine the 'final' vertex position at this frame. If so could you please let me know, thanks!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/07/2005 at 01:46, xxxxxxxx wrote:
So here's what I've been trying that doesn't seem to work (as in the model returns in his default or un-boned pose) :
var file = new(BaseFile); if(!file) return FILEERROR_MEMORY; var objExport; var ok; var setTimeTo = doc->GetTime(); setTimeTo->SetFrame(frame, doc->GetFps()); doc->SetTime(setTimeTo); GeEventAdd(TIMELINE_CHANGED); DrawViews(DA_NO_THREAD); doc->AnimateDocument(ANIMATE_NO_PARTICLES); fname->RemoveLast(); fname->AddLast(stradd(lastString, tostring(frame), ".obj")); println(fname->GetFullString()); if(!file->Open(fname,GE_WRITE)) return FALSE; objExport = new(ObjPerFrameExport); file->WriteString(stradd("# Wavefront *.obj file (frame ", tostring(frame), " of ", tostring(int(frameCount)), ")\n\n")); ok = objExport->SaveObjects(doc,doc->GetFirstObject(),file); // blah blah blah do this: if(instanceof(op, PointObject)) { var copyOf = op->GetClone(0); SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, doc, copyOf, copyOf->GetContainer(), MODIFY_ALL); // mesh vertices { ObjectVertexCount = copyOf->GetPointCount(); if(ObjectVertexCount > 0) { var vertexArray = copyOf->GetPoints(); ObjectVertexArray = new(array, ObjectVertexCount); if(vertexArray) { var i; var ObjectMat = copyOf->GetMg(); for(i=0; i < ObjectVertexCount; i++) { var values; var vertexValue = ObjectMat->GetMulP(vertexArray _); ObjectVertexArray _= vertexValue; values = stradd(tostring(vertexValue.x, ".3g"), " "); values = stradd(values, tostring(vertexValue.y, ".3g"), " "); values = stradd(values, tostring(vertexValue.z, ".3g")); obj->WriteLine(file, "v", values); } } } file->WriteString("\n"); }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/07/2005 at 18:51, xxxxxxxx wrote:
I wrote a plugin that exports animation to lightwave
via a Motion designer file format. You can get the
current deformed vertex position via a "deformed cache"
or something of that nature. Every deformer creates
a cache, that is how C4D deforms meshes non-destructively.
Hope this helps.
-Sadato -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/07/2005 at 12:13, xxxxxxxx wrote:
Anyone have any ideas how I get to that deformed cache?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2006 at 07:24, xxxxxxxx wrote:
Hello deekpyro,
I do not know this cache too, but would it be possible to convert the actual frames mesh into an new pointobject of its own by SendModelingCommand and use the new mesh for export? Never tried out but I think it should work.
Greetings,
COFFEJUNKIE