Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Problem with Undo when using COLOR field in a description resource

    Scheduled Pinned Locked Moved Cinema 4D SDK
    2026c++windows
    3 Posts 1 Posters 23 Views
    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.
    • S Offline
      spedler
      last edited by

      I've encountered an odd problem when a plugin has a COLOR field in a description and Undo (Ctrl-Z) is hit after changing the colour.

      The attached archive contains a small ObjectData plugin called 'Diamond' to demonstrate this (Windows only, debug build). If you install it then invoke it from the Extensions menu, you see it generates a simple polygon object. There are three parameters - height, width and colour.

      To reproduce the problem, change either the height or width parameter to anything. Then, click the 'Color' coloured rectangle and in the colour dialog box change the colour to anything. The object colour changes as expected. Close the dialog, then hit Ctrl-Z to undo the colour change. The colour changes back, but also undoes the previous parameter change to width or height. In fact, if you didn't change anything other than the colour, then hit undo, the object is deleted. It's almost as if the effect is to undo two levels on the undo stack rather than one.

      At first I thought this must be the code I used to change the colour (it's just a call to BaseObject::SetColorProperties()) but not so. Because, if instead of clicking the coloured rectangle you expand the COLOR field to show the colour sliders, you can change the colour using the sliders and undo works normally You can also modify the source so the object colour is not changed at all and the problem still occurs.

      Unless I'm missing something really obvious this looks like a possible bug in the colour picker dialog implementation. (N.B. the full plugin source code is included in the archive.)

      Steve

      Diamond.zip

      S 2 Replies Last reply Reply Quote 0
      • S Offline
        spedler @spedler
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • S Offline
          spedler @spedler
          last edited by

          Apologies - the file upload to my original post doesn't seem to have worked. I tried a different link but that was deleted for some reason. Here's another attempt. You can download the file from my site using this link.

          Hopefully that has worked!
          Steve

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