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

    when I use .GetMg() after the script is finished it seems to return the right results

    Cinema 4D SDK
    python 2024 windows
    2
    3
    467
    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.
    • pyxelriggerP
      pyxelrigger
      last edited by

      When I use .GetMg() after the script is finished it seems to return the right results
      Is this a bug? maybe rerelated to the IK Tag

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

        Hi @pyxelrigger while a screen and a gif is nice, a piece of code is even nicer since it can be copy/pasted and easily read.

        With that's said I think you need to at least execute the scene once with ExecutePasses just after your Message(c4d.MSG_UPDATE).
        The reason is because MSG_UPDATE have the purpose to update internal cache of the geometry, and also set dirty the cache (aka say it needs to be re-generated). This is the same with the tags you added it most likely also set dirtiness (needs to be recomputed on the next scene execution).
        And then you call EventAdd at the end of your script, so you are telling Cinema 4D that he needs to do another ExecutionPass (Scene Execution) which will be what Cinema 4D will do most likely very soon after the Python Script have been executed. And therefor when you run the script in the console, the scene have been executed, and therefor the tag and everything have been executed and therefor the value are "correct".

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • pyxelriggerP
          pyxelrigger
          last edited by pyxelrigger

          Thanks, buddy! It worked. To be honest, I never really understood what Message(c4d.MSG_UPDATE) was all about, and now ExecutePasses is new to me

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