Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    BaseContainer::SetLink with cloned object

    SDK Help
    0
    7
    558
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

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

      On 06/06/2004 at 08:51, xxxxxxxx wrote:

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

      ---------
      Hi,
       
      Having a bit of trouble inserting an cloned object into a BaseContainer.
      Im doing a simple CurrentStateToObject command, and want to add the returned object into the BC.

          
          
          
          
             ModelingCommandData cd;  
             cd.doc = GetActiveDocument();  
             cd.op = op;  
             if(!SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT,cd)) return FALSE;  
              
             BaseObject *oClone = (BaseObject* )cd.result1;  
             BaseContainer *bctag = tag->GetDataInstance();
          
          
          
          
           
          
          
          
          
             bctag->SetLink(DUMMY, oClone);
          
          
          
          
           
          
          
          
          
             BaseObject *object = bctag->GetObjectLink(DUMMY,GetActiveDocument());  
          
      

      As you can see, I directly read the link back again, but object variable is always NULL.
      What confuses me is

          
          
          
          
          bctag->SetLink(DUMMY,op)
          
          
          
      

      works. Both op and oClone are of type BaseObject* so I can't see why one works and the other don't

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

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

        On 06/06/2004 at 09:33, xxxxxxxx wrote:

        the returned object is not in the document that the tag is in I guess. Well, then it won´t work. At least that would be my spontaneous assumption.
        You cannot buy buns when there´s no baker or mall near you either! ;o)

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

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

          On 06/06/2004 at 09:34, xxxxxxxx wrote:

          Or: are you sure that the returned object is valid, so not NULL?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

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

            On 06/06/2004 at 09:35, xxxxxxxx wrote:

            yea, everything not NULL. first thing I checked.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

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

              On 06/06/2004 at 09:57, xxxxxxxx wrote:

              Ok, you was right 3D Designer.
              If I insert the clone object into the document then it works.
               
              but, I dont want to add the clone into the document.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

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

                On 06/06/2004 at 10:04, xxxxxxxx wrote:

                But what reason do you have to link it then when it´s not in the document anyway?

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

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

                  On 07/06/2004 at 02:45, xxxxxxxx wrote:

                  The reason is purely for a quick shortcut.  I want a tag to hold information about a few objects in my scene. I want the tag to hold things like polygon array, object matrix, color properties, the GetName() of multiple objects.
                   
                  But I dont want to hold information of the actual object, so I made a clone so I can modify the contents without distrupting the real objects in the scene.
                   
                  I thought I would add the object into a basecontainer to save me the agony of creating a custom datatype to save the information I need.
                  It was just for a quick hack as I don't have experience creating custom data types and wanted to see results quickly.
                   
                  But I should know that nothing is  as easy as you expect 🙂
                   
                  So time to learn about custom data types

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post