GetClone() crash



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 16/11/2005 at 10:30, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9.5 
    Platform:    Mac  ;  Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Howdy,

    I don't understand why GetClone() crashes by simply replacing the flag COPY_NO_ANIMATION with COPY_NO_BRANCHES. I also tried just adding COPY_NO_BRANCHES to the flags and leaving COPY_NO_ANIMATION in there and it still crashed.

    Here is the code snippet:

      
    BaseObject* destObject = NULL;  
    destObject =(BaseObject* )op->GetClone(COPY_NO_HIERARCHY|COPY_NO_ANIMATION|COPY_NO_BITS,NULL);  
    if (! destObject) goto Error;  
    

    The above code works fine, but I don't want the object's tags to be copied to the new object.

    The SDK doc says for COPY_NO_BRANCHES:
    Don't copy branches, for example tags on an object. Automatically implies COPY_NO_ANIMATION, as animation is a branch.

    From the SDK doc, I would assume all I have to do is use the COPY_NO_BRANCHES, but that causes Cinema to crash.

    How am I supposed to set it up to not copy the tags to the cloned object?

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 16/11/2005 at 11:19, xxxxxxxx wrote:

    Howdy,

    Well, OK, I've now used a work around. Now I'm just checking for tags and deleting them from the clone. I'm going to use this method because I can check for specific tags to delete and keep tags like Phong, UVW, etc., but I'd still like to know why the COPY_NO_BRANCHES flag causes a crash.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2005 at 16:13, xxxxxxxx wrote:

    Any solution on this, Dan? Personally, I think that GetClone() should be pinned to the developers' shirts like a Scarlet letter. I'm not doing GetClone() within a GetVirtualObjects() but am trying to get the hierarchy cloned as well - just trying to clone the damn selected objects and it is crashing under every circumstance.

    My opinion: GetClone() doesn't work under certain circumstances (hierarchies and no branches) - at least not in the 8.012 SDK.

    Again, I want access to basic (but obsfucatedly complex for the developer) actions within Cinema 4D. Copying objects, tags, etc., should be a call to use the Cinema 4D interface, not to an all out war trying to replicate the simplest operations.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2005 at 17:31, xxxxxxxx wrote:

    Howdy,

    Well, I haven't gone back to trying that, Robert. I used my work around instead because I was really only concerned about not copying a couple of specific tags, and I just search for them and delete them immediately after copying the object.

    It would be interesting to know, though why that flag causes a crash.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/12/2005 at 18:56, xxxxxxxx wrote:

    Hi Dan,

    I found the problem - never insert the clones immediately to the document while looping through the document's objects. Instead, an array of BaseObject pointers was needed to store the clones so that they could be inserted after all of the cloning was complete. Again, argh... ;)

    It is possible that there is some sort of interdependency between some of the tags and/or objects in your situation.    I hope that this isn't something that will rear its ugly head since my cloning neither clones animations (unneeded) nor internals (want the baselinks to be unmodified).

    As an aside, I found an odd situation with GetActiveObjects() in 8.012 (not in other versions). As long my AtomArray was filled with valid selections, there was a crash during quit. No selected objects, no crash. As you did, I created a workaround that just scans the document for BaseObjects that are 'active' (BIT_ACTIVE) and away went the crash. Can you say 'unstable'? ;)

    Take care,


Log in to reply