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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Priority confusion

    Cinema 4D SDK
    python r19
    2
    8
    2.0k
    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.
    • chuanzhenC
      chuanzhen
      last edited by

      Hi,
      Recently, the question of priority has puzzled me again. I used to think that the priority of the transformer was generators = 0 (why? Because seeing the help document prompt the priority is initial - animation - expresso -generators, which means that this is their order of calculation, but after using the transformer on a point object, the priority of expresso tag must be Genenrators = 0 to get the correct point position)

      But it doesn't seem like he's working that well, because when I start using it more deeply, it's going to go against my previous conclusion. So I wrote a simple Deformer and a Rag plugin to test my thoughts.

      Deformer:

      def ModifyObject(self, mod, doc, op, op_mg, mod_mg, lod, flags, thread):
          op.SetPoint(0, c4d.Vector())
          op.Message(c4d.MSG_UPDATE)
          return True
      

      Tag plugins: (i can change priority)

      def Execute(self, tag, doc, op, bt, priority, flags):
          op.SetPoint(0, c4d.Vector(100))
          op.Message(c4d.MSG_UPDATE)
          return c4d.EXECUTIONRESULT_OK
      
      
      I used two results to compare.
      • Then I added Deformer and Tag plugin to a polygon object (priority: generators >= 0), but the final result was Deformer.
      • Close Deformer and add an Xpresso tag to control the position of point: 0 if the priority Xpresso > Tag plugin results = Xpresso. This is just like helping the document.

      This result breaks my previous understanding of the order. In what order are Deformer and Tag plugincalculated?

      相信我,可以的!

      1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hi,

        I'm sorry, I need to ask for a bit of patience here. We'll get back to you.

        I have moved this topic to "Cinema 4D Development" category.

        Bye,
        Andreas

        1 Reply Last reply Reply Quote 0
        • chuanzhenC
          chuanzhen
          last edited by

          Hi,Andreas!
          I need your help!

          相信我,可以的!

          1 Reply Last reply Reply Quote 0
          • a_blockA
            a_block
            last edited by

            Hi,

            I'm terribly sorry, you need to wait so long. I have not forgotten you, but still need some input from development.

            Just to be sure I end up in the correct discussion, your question is, why you can not have the tag overwrite the deformer result, by increasing the tags priority to Generator+499, right?

            Cheers,
            Andreas

            chuanzhenC 2 Replies Last reply Reply Quote 0
            • chuanzhenC
              chuanzhen @a_block
              last edited by

              @a_block
              Yes, as you said
              In the time of waiting for your answer, I have been thinking and looking for answers;
              I really can't understand the calculation order, for example, why can't I modify the generator or deformer priority?
              In my opinion, I think of each generator or deformer as a separate calculation method, and then calculate the effect I want in a certain order, but in fact it seems to be a complicated thing in C4D.
              The following picture is my new understanding of the time I wrote:
              0_1537112255757_unstanding.jpg
              (/assets/uploads/files/1537112135975-unstanding-resized.jpg)
              (I am a Character rigger, so sometimes I want to get more control. As my characters become more complex, the priority issues will always be confusing)

              Thanks!

              相信我,可以的!

              1 Reply Last reply Reply Quote 0
              • chuanzhenC
                chuanzhen
                last edited by chuanzhen

                I used the result of the skin of the 01 object, after using my own objectdata plugins, after the skin, using the poly matrix to constrain the joint of the object 02, the result is correct in the rendering window, but when I drag the time slider, The viewport sometimes has a delay, or I need to redraw it by pressing "A". How can I know how the interior of cinema 4d is calculated, although the above picture is my last thought, but this time the result seems to overturn my conclusion.

                Although I can know how to implement a constraint effect, how to calculate it with code, but always delay my theoretical calculation results in Cinema 4d.

                How does the Priority ? Deformer /Generator cache work,Make me confused ☹

                相信我,可以的!

                1 Reply Last reply Reply Quote 0
                • chuanzhenC
                  chuanzhen @a_block
                  last edited by

                  @a_block I need your help again!
                  As I said above, what I missed in my plugin, when I drag the timeline slider, sometimes it will delay, but the result in the render window is correct.(i find that if i stop drag the time slider,then rotate or pan viewport,then drag timeline slider,the delay will definitely happen)

                  相信我,可以的!

                  1 Reply Last reply Reply Quote 0
                  • chuanzhenC
                    chuanzhen
                    last edited by

                    For viewport delay: i rewrote Skin Deformer ,Add a Aim Object to Check DeformCacheDirty To achieve my purpose(keep viweport realtime Refresh),yes ,it work.
                    I have been updating the post, hoping that I can understand what the problem is on the right path, instead of exploring the working mechanism of Cinema 4D in other ways. Although I don't get the official answer, this will not dispel my enthusiasm for exploration the answer.☺ (English is not very good, I hope to understand what I express)

                    相信我,可以的!

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