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

    deformer don't work when called via code

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 256 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.
    • H Offline
      Helper
      last edited by

      On 04/09/2016 at 23:15, xxxxxxxx wrote:

      hello , 
      when I call the correction deformer via this code

       corr = c4d.BaseObject(1024542) #define the correction deformer
       doc.InsertObject(corr)
       c4d.EventAdd() 
      

      the new object don't work , when I use the CallCommand every thing work as expected .
      I have tried the code above with the ben deformer and it worked as expected

      any idea why this is happening ?

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

        On 05/09/2016 at 05:45, xxxxxxxx wrote:

        Hi,

        some objects need some work done on initialization. Therefor MSG_MENUPREPARE is used. In the new C++ SDK Docs, there are a few more words on it in the manual about General Plugin Functionality.

        For example, the Correction Deformer needs to create a Tpolygon and a Tpoint tag in there in order to be fully functional.

        So to make it work your code looks like this:

        corr = c4d.BaseObject(1024542) #define the correction deformer
        corr.Message(c4d.MSG_MENUPREPARE)
        doc.InsertObject(corr)
        c4d.EventAdd() 
        

        If you have the possibility to compile the C++ SDK examples, there's a nice little tool in there. The "Active Object Dialog". With this you can take  a look into the scene. Great for understanding object caches. And in your case, you would see the two hidden tags on the Correction Deformer, which is a good hint, that the object probably needs MSG_MENUPREPARE.

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

          On 05/09/2016 at 08:09, xxxxxxxx wrote:

          thanks for reply , 
          didn't know there is a relationship between python and c++ , I will check the tool that you have mentioned 🙂
          thanks again for the help

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