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

    Creating my own color preferences

    Cinema 4D SDK
    3
    3
    529
    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.
    • T
      tdapper
      last edited by tdapper

      Hi everyone,

      I'm trying to add my own color preferences and add them to the "Scheme Colors" section in the Cinema 4D preferences, similarly to what Hair does.

      To do so, I successfully add and register a PrefsDialogObject. I used a description similar to the Hair one in prefshaircolor.res/prefshaircolor.h and it displays fine. The implementation is based on an earlier thread from the forum (and a bit of prior experience): https://developers.maxon.net/forum/topic/11737/default-startup-settings/4

      It works pretty much fine, the preferences show up in the right place and I am able to control the colors in the list view the same way it works in all the other color preferences. I even added that "Reset..." button. The only problem is that the data in the ListViewData element does not appear to be restored properly when Cinema 4D starts up again. I tried other data types like Int32 and those are brought over into a new session just fine.

      When looking at the BaseContainer with my Plugins' settings I see that when I call BaseContainer::GetData() on it, the resulting GeData is of type DA_MISSINGPLUG, which to me looks like Cinema 4D is somehow not able to restore the data element from the preferences. It looks a little like that might be because the ListViewData custom datatype hasn't been registered when the preferences are restored?

      However, I am assuming that the regular Cinema 4D color scheme preferences somehow store their setting and when loading the Hair preferences via HairLibrary::GetPrefsInstance(), I see the container it returns contains elements of type CUSTOMDATA_LISTVIEW (1018397), so it somehow must be possible to store values of that type in the preferences.

      Did anybody run into similar problems before and can help me? I'm feel like I must be missing something trivial here.

      Thanks in advance for any help!

      Best
      Timm

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

        Hi @tdapper, the hair color preferences are automatically loaded from a file during C4DPL_STARTACTIVITY and saved within C4DPL_ENDACTIVITY, So you will need something similar for your plugin to properly serialize and load data.

        If you still have issue, could you share your code, so we can have a look of what is wrong.
        Thanks in advance,
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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

          Hello @tdapper ,

          Without any further questions, we will regard this topic as solved and flag it accordingly by Monday, September, the 8th.

          Thank you for your understanding,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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