Animation Sequences ?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 15:42, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.012
Platform: Windows ;
Language(s) : C++ ;---------
Hi !How can I get the Animation Sequences for Bones ? (Cinema is quit complex )
I tried for test this:
BaseTrack* Track = doc->GetFirstTrack();
BaseSequence* Seq = Track->GetFirstSequence();
BaseKey* Key = Seq->GetFirstKey();
BaseList2D* Object = Key->GetObject();
String Name = Object->GetName();
GePrint(Name);But i get an Exception ... NullPointer
Someone know the answer ?
Thanks
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 16:17, xxxxxxxx wrote:
Like any programming practice, you should check for valid pointers before using them. There might not be a Track or Seq or Key or Object, any of which would return a Null pointer exception.
Never assume that they exist.
Robert
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 17:24, xxxxxxxx wrote:
Hmm ur right, but ive made a Bone Animation Sequence
I hate it ... Mc Donalds ^^
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 18:23, xxxxxxxx wrote:
Uhm, i tried now much, but i dont get the Animation Tracks I need them to save to Bone Animations (Which Bone, From Frame - To Frame, Frames).
I tried GetFirstTrack no success, i tried GetFirstRenderData no succes
Ive no Idea, how can i get these f**k data ?
I get crazy
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 19:35, xxxxxxxx wrote:
I think I see your problem: BaseDocument doesn't have Tracks. The 'Document' is not animatable, only the objects, materials, tags. Just because it is an option for a GeList2D doesn't make it available.
You need to get your Tracks from the animated Objects.
From the Documentation:
_BaseTrack *GetFirstTrack(void)
Returns the first animation track of the object._
So, get your Document's Objects and get the Tracks from the Objects.
Robert
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/01/2005 at 23:34, xxxxxxxx wrote:
So you mean i should get the Animations (Keyframes from Bones) directly from the Object ?
Ok i will try, but i won't work. Yesterday I let Cinema Print all Names of the objects (with you printhistory / printchildren functions).
But the Names of the Bones wasn't listed ...I Printed the Names without an If, i just Printed all Names. I tried with my own rekursion function but the same problem.
Here the rekursion (dunno this word on english ;)) function:
void PrintChildren(BaseObject *obj)
{
if(!obj)
return;DoParse(obj);
PrintChildren(obj->GetDown());
PrintChildren(obj->GetNext());
// PrintChildren(obj->GetPred());
// PrintChildren(obj->GetUp());
}void PrintHierarchy(BaseDocument *doc)
{
if(!doc)
return;BaseObject *obj = doc->GetFirstObject();
if(!obj)
return;DoParse(obj);
PrintChildren(obj);
}DoParse is my little Helper
It only makes Stuff like this:
if(Obj->GetType() == Opolygon)
{
HELPER_AddVertex(Obj);
}
...My ICQ 82 921 889
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/01/2005 at 00:53, xxxxxxxx wrote:
Yes, get the Tracks from the Object. This code is from the MorphMixer.cpp example source that comes with the SDK. It doesn't get the animation info, but it should give you an idea of how to work through the existing animation info.
static Bool CreateKey(BaseDocument *doc, BaseObject *op, const BaseTime &time;, LONG index, Real value) { // check if track exists BaseTrack *track = op->FindTrack(DescLevel(index,DTYPE_REAL,0)); if (!track) { track = AllocValueTrack(op,DescLevel(index,DTYPE_REAL,0)); if (!track) return FALSE; op->InsertTrackLast(track); } // check for sequence BaseSequence *seq=NULL; for (seq = track->GetFirstSequence(); seq; seq=seq->GetNext()) if (time>=seq->GetT1() && time<=seq->GetT2()) break; if (!seq) { seq = track->AutoAddSequence(doc,time); if (!seq) return FALSE; } BaseKey *key = BaseKey::Alloc(seq->GetType()); if (!key) return FALSE; AnimValue *av = GetKeyValue(key); if (!av) return FALSE; av->value = value; key->SetTime(time); seq->InsertKey(key); return TRUE; }
And here is my working print hierarchy code:
// Print Hierarchy void PrintHierarchy(BaseDocument *doc) { BaseObject *obj; if (!(obj = doc->GetFirstObject())) return; PrintChildren(obj); } // Print Children recursively void PrintChildren(BaseObject *obj) { for (; obj; obj = obj->GetNext()) { GePrint(obj->GetName()); if (obj->GetDown()) PrintChildren(obj->GetDown()); } }
One thing to mention, just to be sure: the objects MUST be in the document - added to document with doc->InsertObject(obj,...). Virtual objects (not added to any document) will not show up in a document's object hierarchy.
Robert
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/01/2005 at 01:01, xxxxxxxx wrote:
Thanks Robert !
RE:
One thing to mention, just to be sure: the objects MUST be in the document - added to document with doc->InsertObject(obj,...). Virtual objects (not added to any document) will not show up in a document's object hierarchy.-Uhm ... i dont make the Models, the guy who makes it simply makes bones with vertexmaps and bones
Hmm ... i will test ur code.// Edit
I have tested your code, it dont show bones 2 U said i must add to document but the Modeler only use standard bones from Cinema 4d
// Edit 2
Hey Rob, i found something out...
When I create a Bone then it shows it, when i make it a subentity of another object than not ?_?Examples:
Single->Bone Object
->Other Stuff=> works
Subentry
->Other Stuff
-->Bone Object=> dont work ?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/01/2005 at 10:09, xxxxxxxx wrote:
Huh ?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/01/2005 at 12:39, xxxxxxxx wrote:
Hi furbolg
I wrote this msg to you"
HiI'm building an exporter plugin like you (at the moment it's exports vertices, averaged normals, uvws, and made some pre-calcs about volume shadows) so i think it's a good ideia to us if we could talk about that
Do you have ICQ or MSN?
My ICQ number: 35142180
My msn: [email protected]Thx
i'm waiting your answer."
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/01/2005 at 15:47, xxxxxxxx wrote:
Uhm we can but i dont got much infos u dont know ^^