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

    event-handler would be usefull

    General Discussion
    0
    2
    390
    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 28/01/2013 at 07:12, xxxxxxxx wrote:

      Hi everybody, I'm newbie with this api although I've experience programming (not precisely python or coffee 😠) I've found than many times I wish fire a event..for example

      the user select knife..I can't found in the documentation (I've not reading this so deep sorry) how know when the tool is used...would be interesting can use event-handler or nice callback for chain events:

      c4d.CallCommand(<knife tool code> , lambda vectorOfCut: print("you cut in "+  vectorOfCut))

      c4d.CallCommand(<knife tool code> , lambda _: c4d.CallCommand(<other tool>, print("both tools executed"))) #here when the first tool is executed fire my other tool

      although the python lambdas are really limited I think than maybe this would be a good feature and not so hard to implement 😉 ...

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

        On 28/01/2013 at 08:32, xxxxxxxx wrote:

        first of all, c4d has some sort of event system, they are called messages and do come in
        different versions of access and reach. in cpp you also have the option of scene hooks to
        alter fundamentally the behaviour of c4d.

        c4d.CallCommand is a scripting command and is not meant to pass any parameter 
        except for the toolid. there is c4d.utils.sendModelingcommand which gives you more 
        access to the tools, but it is also quite buggy. you will not be able to execute the 
        knife tool with smc. generally speaking you won't be able to execute modelling tools 
        programmatically with the sdk at a larger scale.

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