Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    How to get InExcludeData in ModifyObject

    Cinema 4D SDK
    r20 c++
    2
    4
    792
    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.
    • M
      mike
      last edited by mike

      hi, this is my code. I can get InExludeData in Message(..) , but it can't work in ModifyObject(..),just print 0.where did i wrong?
      hope for your help!

      Bool TestObjectPlugin::ModifyObject(BaseObject * mod, BaseDocument * doc, BaseObject * op, const Matrix & op_mg, const Matrix & mod_mg, Float lod, Int32 flags, BaseThread * thread)
      {
              GeData gd;
              BaseContainer* data = mod->GetDataInstance();
      	Bool success = data->GetParameter(DescID(MY_InExludeData),gd);
              if(success){
                  if (gd.GetType() == CUSTOMDATATYPE_INEXCLUDE_LIST) 
                  {     
                 		GePrint("Currect"_s); 
                  }        
                  else
                  { 
                 		GePrint(maxon::ToString(gd.GetType(), false));
                  }    
               }
      }
      
      1 Reply Last reply Reply Quote 0
      • M
        mike
        last edited by

        Maybe I know the reason why it error in my project,ModifyObject will be call when under the currect object,and success valuse always True ,even InExcludeData == nullptr.

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by Manuel

          hello,

          I've run some test and it print 0 if i do not initialize the gadget. Once i drop an object on the in-exclude list it's working correctly.

          So did you have initialize the gadget in your Init() function ?

          something like so in your case.

          BaseObject*		 op = (BaseObject*)node;
          BaseContainer* data = op->GetDataInstance();
          
          data->SetData(MY_InExludeData, GeData(CUSTOMDATATYPE_INEXCLUDE_LIST, DEFAULTVALUE));
          	
          

          Cheers
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

          M 1 Reply Last reply Reply Quote 0
          • M
            mike @Manuel
            last edited by

            @m_magalhaes Thank you for your answer. really helpful!

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