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

    Value Driven Effector not updating? [SOLVED]

    SDK Help
    0
    11
    855
    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 18/05/2016 at 06:49, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   16 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi,

      I want my value driven effector to be updated on each frame. How is this accomplished? I have no other object dependency so cannot use AddEffectorDependence().

      Thanks!

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

        On 18/05/2016 at 06:55, xxxxxxxx wrote:

        Howdy,

        Maybe in a MessageData plugin?

        Adios,
        Cactus Dan

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

          On 18/05/2016 at 07:03, xxxxxxxx wrote:

          Thanks Dan first of all!
          I rather not want to create a plugin to update a plugin though.

          I mean the random mograph effector for example, it updates automatically each frame. I don't think C4D is updating this from the outside? So there must be an "internal" way of saying "do update!".

          I could detect temporal changes manually, so is it for example safe to just set my effector dirty?
          I would assume that AddEffectorDependence() is doing this when the linked object is dirty (but it would help to know from where e.g. InitPoints() is called in the first place).

          Cheers

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

            On 18/05/2016 at 10:27, xxxxxxxx wrote:

            Howdy,

            What about the Execute() function?

            Adios,
            Cactus Dan

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

              On 18/05/2016 at 11:20, xxxxxxxx wrote:

              Hey,

              Can you elaborate? Not sure I understand. Is it called per frame only?

              I was going from the noiseeffector example (https://github.com/PluginCafe/cinema4d_cpp_sdk/blob/master/source/object/noiseeffector.cpp) in the SDK (which does not use the Execute function but it does not require per frame updates).

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

                On 18/05/2016 at 11:53, xxxxxxxx wrote:

                Howdy,

                No, but you could check to see if the frame has changed within the Execute function. 😉

                Adios,
                Cactus Dan

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

                  On 18/05/2016 at 13:30, xxxxxxxx wrote:

                  thanks Dan. 🙂 However I am not sure if it is the right place because Execute() is called in a thread context.
                  And MoGraph uses the message system to execute the virtual functions it provides, so the question is, can it result in Execute() being called before the mograph function calls?

                  Anyway, thanks to your pointer to the Execute() member I found ExecuteEffector() which is called first in the effector pipeline according to the docs. This seems like a valid place I guess.

                  Cheers!

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

                    On 18/05/2016 at 14:23, xxxxxxxx wrote:

                    I think CheckDirty() is also called for Effector plugins, and if you set your effector dirty, it should be re-evaluated.

                    Cheers,
                    Niklas

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

                      On 18/05/2016 at 15:36, xxxxxxxx wrote:

                      Now this is of course even better! You are right, it can be overloaded for Effectors (I checked the API). Thanks Niklas!

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

                        On 19/05/2016 at 01:53, xxxxxxxx wrote:

                        Hello,

                        there is the flag EFFECTORFLAGS_TIMEDEPENDENT that might be used in such cases.

                        Best wishes,
                        Sebastian

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

                          On 19/05/2016 at 07:02, xxxxxxxx wrote:

                          Thanks Sebastian. Excellent. Guess this is more than solved now. 🙂

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