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

    2024 Conversion questions

    Cinema 4D SDK
    2024 c++
    2
    2
    528
    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.
    • R
      Rox
      last edited by

      Hello,

      I have a few questions about 2024 conversion that I am combining into 1 post.
      The plugin is a object data plugin with resource description.

      1. GetDParameter bitmapbutton
      Bool GetDParameter(GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
      {
      	
      	switch (id[0].id) 
      	{
      		case MY_BITMAP:
      		{
      			Int32 dirty = 0;
      			BitmapButtonStruct bbs(static_cast<BaseObject*>(node), id, dirty);
      			t_data = GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs);  // ERROR
      			flags |= DESCFLAGS_GET::PARAM_GET;
      			break;
      		}
      
      1. BaseSelect
      BaseSelect* bs;
      
      			if (polygonCnt > 0)
      			{
      				SelectionTag* sTag = SelectionTag::Alloc(Tpolygonselection); 
      myObj->InsertTag(sTag, 0);
      			
      		
      				bs = sTag->GetBaseSelect();   // ERROR
      
      1. IncludeExclude
      InExcludeData* myList= (InExcludeData*)bc->GetCustomDataType(MY_ID, CUSTOMDATATYPE_INEXCLUDE_LIST);   // ERROR
      

      Thanks.

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @Rox
        last edited by ferdinand

        Hey @Rox,

        Thank you for reaching out to us. You really should have a look at the migration guide, as these topics are covered there. We cannot debug every compiler error here for you, nevertheless here are the answers to your three problems:

        
        // 1 - That should fix it as the signature is now:
        //    GeData( const CustomDataType & data, Int32 type )	
        t_data = GeData(bbs, CUSTOMDATATYPE_BITMAPBUTTON); 
        
        // 2 - Selections are now COW and make a distinction between being mutable and immutable. 
        const BaseSelect* const mySelection = sTag->GetBaseSelect();   // immutable
        BaseSelect* const mySelection = sTag->GetWritableBaseSelect(); // mutable
        
        // 3 - Same story here, GetCustomDataType returns immutable data now, the method is also templated 
        // now, so you do not need to cast things anymore.
        const InExcludeData* const myList= bc->GetCustomDataType<InExcludeData>(MY_ID);
        InExcludeData* const myList= bc->GetCustomDataTypeWritableObsolete<InExcludeData>(MY_ID);
        

        Cheers,
        Ferdinand

        edit: forgot the template argument in BaseContainer::GetCustomDataType

        MAXON SDK Specialist
        developers.maxon.net

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