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

    Adding scripts to a menu

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 351 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 07/07/2015 at 08:21, xxxxxxxx wrote:

      I am trying to add specific scripts to a menu, I can add the script using the ID cinema gives it by default, but this is not a locked ID and can change. Is it possible to predefine an ID for a script similar to registering a plugin?

      EDIT:

      Just discovered GetCommandName(_<_gs_>_) so now I can just iterate through a range of id's and add the script if it matches a name. Though it would still be nice to lock an ID to a script.

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

        On 08/07/2015 at 02:14, xxxxxxxx wrote:

        Hello,

        I just want to make sure we understand what you are talking about: do you talk about scripts from the Script manager? And how exactly do you want to add a script to a menu?

        Best wishes,
        Sebastian

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

          On 08/07/2015 at 06:30, xxxxxxxx wrote:

          Yes, scripts from the script manager. (If there is another way to load scripts into cinema that would be nice.)

          What I ended up doing is iterating through the 600000000+ ID range and checking the names against preset lists and sort them into subgroups accordingly.

          It would be nice to have a way to identify a script without using the name. If the name gets changed, then it won't get added to the menu. I would have to check the contents of the script to counter act that.

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

            On 08/07/2015 at 10:43, xxxxxxxx wrote:

            Hello,

            indeed, the IDs of the scripts are created dynamically and may change every time Cinema starts. You have to use the script name to identify a script. I think one can assume that when the script name is different, this is because the content is different.

            Best wishes,
            Sebastian

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