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

    How to allocate a gradient in Python?

    PYTHON Development
    0
    22
    12.5k
    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 10/06/2013 at 00:12, xxxxxxxx wrote:

      The symbols file is is needed because it is part of the resource associated with a plugin or more
      specifically its look up table the resource parser is using to identify certain elements.

      In python description ids are imported properly(automatically) from the symbols file, everything 
      else - custom ids, dialog ids is not. The reason ? Only god knows why. You have either to copy 
      the values or write a little parser for the symbols file which does autoimport its members to your 
      project.

      The downside of auto importing - if you are using an IDE,  it won't know your symbols constants 
      anymore, so will loose the autocomplete feature on these. That is why I personally went back
      to simply copy pasting the symbols file. With a little macro you can make it one press of a button.

      edit : You could of course write an autoimporter that doesn't work at runtime, but (over)writes
      a python symbols definition py(c) file, but doing that properly will be a bit more work. as you
      will have to analyze existing code in the file and so on.

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

        On 10/06/2013 at 00:44, xxxxxxxx wrote:

        Originally posted by xxxxxxxx

        In python description ids are imported properly(automatically) from the symbols file, everything 
        else - custom ids, dialog ids is not. The reason ? Only god knows why. You have either to copy 
        the values or write a little parser for the symbols file which does autoimport its members to your 
        project.

        ⭐ https://github.com/NiklasRosenstein/c4dtools#example-code

        c4dtools does this for you, and it also allows parsing the description resources so you don't have to
        fuzz with the symbolcache. Well, if you're using an IDE, you won't have the symbols in the auto-
        ompletion, but you could also write a script that parses the resource symbols and creates an
        importable Python file that contains the resources.

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