How to get InExcludeData in ModifyObject



  • 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));
                }    
             }
    }
    


  • 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.



  • 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.



  • 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



  • @m_magalhaes Thank you for your answer. really helpful!


Log in to reply