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

    Make Editable example [SOLVED]

    SDK Help
    0
    25
    15.1k
    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.
    • H
      Helper
      last edited by

      On 10/04/2015 at 03:28, xxxxxxxx wrote:

      Hi Andreas,

      Thanks for your feedback!
      I'll try to do it the better (your) way.

      But what I'm wondering is, why is the method GetContour() used inside the DoubleCircle SDK example? Doesn't that give threading problems?

      Also, I'm changing the active object again after making it editable. The user also doesn't need to select any objects while working with my plugin, just sliders.

      Greetings,
      Casimir Smets

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 10/04/2015 at 03:45, xxxxxxxx wrote:

        Hi Andreas,

        Another quick question: is GetContour() giving the big problem here? Or also the way I'm making my objects? Or is that a matter of personal preference and style?

        Thanks for your time and help!
        Greetings,
        Casimir Smets

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 10/04/2015 at 03:58, xxxxxxxx wrote:

          Hi,

          the problem is to call CallCommand() and InsertObject() within GetContour().
          GetContour() is called in a thread context, while CallCommand() and InsertObject() are not allowed to be used in a thread context.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 10/04/2015 at 06:43, xxxxxxxx wrote:

            Hi, me again 😉

            We had some discussion about this thread in our team and perhaps I should add some more info.
            First of all there's an article about threading in the SDK docs: Important Threading Information

            Some more on GetContour(), the same is true for GetVirtualObjects() :
            These functions are only thought to generate a spline or an object (these also may have childs) and then return these. Cinema 4D will handle all the integration into the scene. And as these are called in a thread context, you must never ever do any changes directly to the scene in these functions.

            Finally I completely ignored the "PolygonObject in GetContour" problem. I'm wondering, what you are actually trying to do with this object in GetContour(), as you can't return it and are not allowed to insert it into the scene. The correct place to generate your PolygonObject would rather be GenerateVirtualObjects().

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 20/04/2015 at 07:50, xxxxxxxx wrote:

              Hi Andreas,

              Thanks for your information!
              I've tried and tried, but without success.
              Could you maybe provide me with a simple example on how to add a nullobject-child to the cube (parent).

              Also, I'm not allowed to use InsertUnder() inside GetVirtualObjects, right? Or am I wrong?

              Thanks for your help and time!
              Greetings,
              Casimir Smets

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 20/04/2015 at 08:52, xxxxxxxx wrote:

                Hi,
                you may use InsertUnder() and alike inside GVO. But you are not allowed to make changes to the active scene (only your objects cache) with these functions during GVO. If you generate a cube in GVO, you are allowed to use InsertUnder() to insert a Null Object as child of the cube. And then later on you can return the cube as result from GVO.
                You can simply check it. Just select your generator object and hit the c key. You will see the hierarchy you generated within the Object Manager.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 20/04/2015 at 11:20, xxxxxxxx wrote:

                  Hi Andreas,

                  Unfortunately, that doesn't work with me. I've tried to add a sphere to the cube with InsertUnder, but nothing to see inside Cinema 4D. Could you please provide me with a simple example on how to add a BaseObject to the cube? It doesn't matter which object.
                  Thanks for your help and time!
                  Greetings,

                  Casimir Smets

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 20/04/2015 at 12:22, xxxxxxxx wrote:

                    Hi,

                    I've finally got it to work, but now my next problem comes up. I have more than a few null objects inside my plugin, but when I make it editable/current state to object, it deletes that null objects, which is definately not what I want. Especially because some are helper objects for their childs.

                    Is there any way to let null objects stay after making something editable?

                    Thanks for your help and time!
                    Greetings,

                    Casimir Smets

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 20/04/2015 at 12:26, xxxxxxxx wrote:

                      Hi,

                      Allready found my own solution. If you have a null as child, it disappears when making editable/current state to object. If your null is a parent for another object (NOT NULL) it does not go away.

                      Greetings,
                      Casimir Smets

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

                        On 21/04/2015 at 12:06, xxxxxxxx wrote:

                        Hi,

                        You can mark this as solved!
                        It works like the way Andreas showed on page 1.

                        Greetings,
                        Casimir Smets

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