Modeling Library Question



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

    On 26/09/2010 at 14:52, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   12 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    I may be overlooking this in the Modeling Library docs but I am wondering if it is safe or even valid to call InitObject() and Commit() within a loop.  So for example the flow would look like this....

    Begin Loop,

    Call InitObject(),

    modify object with Modeling library,

    Call Commit(),

    Call ReleaseObject(),

    GOTO Top of Loop and do it again.

    Is this valid or no?

    ~Shawn



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

    On 27/09/2010 at 13:34, xxxxxxxx wrote:

    Anyone know about this?



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

    On 29/09/2010 at 07:48, xxxxxxxx wrote:

    Yes, it's valid to do so.

    cheers,
    Matthias



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

    On 29/09/2010 at 09:13, xxxxxxxx wrote:

    Thanks Matthias.  Is my understanding correct?  This is valid unless I do something to the object that changes the orginal object as it was when I used InitObject(),  right? 
     
    So in theory, I can initialize the object, loop through the points, make changes, commit the changes, release the object, and then do iot all again.  I just can't commit changes, and then make more changes without releasing the object, and re initializing it?
     
     
    Thanks,



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

    On 29/09/2010 at 19:08, xxxxxxxx wrote:

    The SDK says the following:

    MODELING_COMMIT_UPDATE
    Commit updates its internal data so that further editing can be done without having to reinit the kernel. This only applies if the committed object is the same as the original; you can always commit the changes to another (clone) object without having to reinit.

    Could someone explain to me how I would do the bold text part of this?

    Would I create a clone of the object like this?

      
      BaseObject * cubeClone = (BaseObject* )cube->GetClone(COPYFLAGS_NO_HIERARCHY, NULL);  
      if(!cubeClone) return FALSE;
    

    I am confused by this ....  Does it mean that I use InitObject() for my polygonObject then when I make a change to the object, make a clone of the object and then make another change to the original object then save it to a clone..   Could someone provide a short snippet of code to explain this better?

    Thanks,

    Shawn


Log in to reply