BaseLink array & Read/Write/CopyTo
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/12/2006 at 14:53, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.2-10.0
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;---------
Samir, I saw a post from last year where you were working on something similar to this but not too much detail on the process was divulged. First, realize that I'm supporting back to R8.2 which means that MSG_DOCUMENTINFO is moot. MSG_MULTI_DOCUMENTIMPORTED is valid though.I take it that you use Write to write the BaseLinks to Hyperfile. But then you don't use Read to read them in, correct (?). Can you show code on how you did this?
I'm trying to remove recursive calls from GetDDescription() so that a bone hierarchy can be stored once with an array of BaseLinks in a plugin tag and that array used instead to avoid recursion (in many, many places). The goal is to reduce the lag caused by all of this recursion (esp. places like GetDDescription() which is called continuously).
Simple enough to there, but the Read/Write/CopyTo for this BaseLink array is where I want to be certain.
Thank you very much,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/12/2006 at 09:56, xxxxxxxx wrote:
Hi Kuro,
can you show me the old post? I don´t remember actually and as I had a hardware crash this year, it may be very possible that I don´t have the code anymore.
Let me know and I´ll try to help you as much as possible.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/12/2006 at 14:04, xxxxxxxx wrote:
Hello,
Click here
Any help that you can offer is much appreciated. Still not sure how you Read the BaseLink and then resolve the link - don't get it.
Thanks,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/12/2006 at 06:01, xxxxxxxx wrote:
hey Kuro,
thanks and now I also know where I used this. But I have bad news for you.
Due to the non-existance of the objects during the Read function, I handled the loading and saving in the message function using MSG_DOCUMENTINFO, which you apparently cannot use due to the version limitation?! But that´s the only way I found out about as I simply couldn´t use the Read method.Here is some code directly out of MountMonkey, maybe it helps or inspires. I stored the baselinks in the container bf and am using that one then to read out the baselinks.
DocumentInfoData* did = (DocumentInfoData* )data; switch(did->type) { case MSG_DOCUMENTINFO_TYPE_LOAD: case MSG_DOCUMENTINFO_TYPE_MERGE: { BaseContainer bf = vdata->GetContainer(MONKEYCONTAINER); LONG start = 1000; NodeMaster* m = dlg.GetMaster(); m->SetPreviewSize(256); //Rebuild the tag stuff... NodeGroup* scene= m->GetFirstNodeGroup(); if(!scene) return FALSE; NodeArray<NodeCore*> *nodes = scene->GetNodes(); if(!nodes) return FALSE; [..] BaseTag* link = (BaseTag* )bf.GetBaseLink(start++)->GetLink(did->doc); [...] } break; case MSG_DOCUMENTINFO_TYPE_SAVE_BEFORE: case MSG_DOCUMENTINFO_TYPE_SAVEPROJECT_BEFORE: { BaseContainer bf; LONG start = 1000; NodeMaster* m = dlg.GetMaster(); NodeGroup* scene = m->GetFirstNodeGroup(); if(!scene) return FALSE; [..] bf.SetLink(start++,node->GetTag()); [...]
Hope that helps
Samir -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/12/2006 at 07:52, xxxxxxxx wrote:
Ah, so MSG_MULTI_DOCUMENTIMPORTED might work one way (for reads) but this isn't called, of course, when the document is saved (writes).
I do compile different versions (8.2, 8.5, 9.1, 10.0) mainly because I'd rather not stick, say, 10.0 users with the limitations of 8.2 - that'd be horrible. The plugin is just designed to work with 8.2 as minimum and takes advantage of later features by including/excluding the code (with directives).
I'll look at your code and some other ideas. Need to see what messages might be sent when both loading and saving back in 8.2.
Thank you very much,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/12/2006 at 15:03, xxxxxxxx wrote:
I see that my BaseObject BaseLink list on the sub-BaseContainer is also returning NULL links when reloading a saved document. Probably because the tag is on the root object and the BaseLinks on it are to BaseObjects underneath.
I must ask this question. Is there any purpose to saving these BaseLinks to a document if they must be reinstated on every load? Seems best to just recurse the figure's bones on each document load, basically redoing the BaseLinks list.
Don't have a reason why my master-slave BaseLink lists (to tags only) seem to be rather solid. Is this something to do with where tag 'nodes' are stored in the C4D document as compared to object 'nodes'?
For the sake of argument, I'm also going to check all of the master-slave links on document load. If any show up as NULL, it will require a reinstatement there as well.
Welcome to more work.