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

    Cannot set ID_BASEOBJECT_USECOLOR to a child object.

    Cinema 4D SDK
    2
    4
    637
    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
      mastergog
      last edited by mastergog

      Hey guys, i'm on R23, Windows, C++ and I have an issue setting ID_BASEOBJECT_USECOLOR.
      Basically I have a spline object as a sub-object of my ObjectData plugin which I want to have a solid color.
      In GetVirtualObjects() before inserting this spline under my cache root, I use the following:

                              splineObject->SetParameter(DescID(ID_BASEOBJECT_USECOLOR), ID_BASEOBJECT_USECOLOR_ALWAYS, DESCFLAGS_SET::NONE);
      			splineObject->SetParameter(DescID(ID_BASEOBJECT_COLOR), Vector(1,0,1), DESCFLAGS_SET::NONE);
      

      But this doesn't work...
      Also tried setting with the ObjectColorProperties struct but no luck:

                              ObjectColorProperties props;
      			props.color = Vector(1, 0, 1);
      			props.usecolor = ID_BASEOBJECT_USECOLOR_ALWAYS;
      			splineObject->SetColorProperties(&props);
      

      Any ideas what I'm doing wrong?

      EDIT: In edit mode I manage to do set them separately for each of my objects, so I assume it's possible.

      Thank you for the attention!

      -Georgi.

      1 Reply Last reply Reply Quote 0
      • M
        mastergog
        last edited by

        One thing that wasn't mentioned.
        All the children objects seem to inherit the properties from the base object. If I set the base objects properties with the code in my previous post, the spline object will receive them.
        Maybe there's a way to tell some objects to inherit and others to not?

        1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by

          Hi @mastergog please for your next topic, try to use the Q&A functionality.

          Regarding your issue, you should first register your object plugin with the flag OBJECT_USECACHECOLOR.
          Then if you are returning multiple objects a good practice is also to define an UniqueIP for each of them, for more information please read BaseObject - Generating

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          M 1 Reply Last reply Reply Quote 0
          • M
            mastergog @m_adam
            last edited by

            @m_adam Yay thank you very much! Was almost ready to compromise with the default color.

            Will use the Q&A functionality, excuse me for the posts so far.

            Warm regards,
            Georgi.

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