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

    Why does "Symbols Parser" not work?

    Cinema 4D SDK
    python
    2
    3
    571
    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.
    • L
      LingZA
      last edited by LingZA

      Why does "Symbols Parser" not work?
      The API document is below.
      https://developers.maxon.net/docs/py/2023_2/manuals/foundation/symbols.html?highlight=c4d_symbols

      I changed "py-fresnel_r13.pyp" in official plugin examples.
      144c0cf7-1530-486d-bdf7-6018f3e37f59-image.png
      38a80529-5925-4d5c-9c15-354e8597065b-image.png
      Finally, I got the issues.
      b1678ae6-5f63-4364-9c42-0c429436d372-image.png

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

        Hi @LingZA,

        There is actually 2 issues, one in your side and one in our side.

        The one from your side was that you passed the wrong folder to parse_and_export_in_caller . This function expect the folder containing the symbols.
        So you need to adapt the .pyp file to something like:

        c4d_symbol_dir = os.path.join(os.path.dirname(__file__), "res")
        symbol_parser.parse_and_export_in_caller(c4d_symbol_dir)
        
        c4d.plugins.RegisterShaderPlugin(PLUGIN_ID, c4d.plugins.GeLoadString(IDS_PY_FRESNEL), 0, PyFresnel, "", 0)
        

        Then there is a bug in the symbol_parser, which don't recognize correctly values from enum without a space between the symbol name and it's value. So you need to edit the header file from
        IDS_PY_FRESNEL=10000, to IDS_PY_FRESNEL = 10000,

        The fix to support symbol name without space will be in the upcoming build.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • L
          LingZA
          last edited by

          Great!!! It runs.
          You are right. Thank you so much!
          I think your answer is worth being written in the API document to make the workflow more clear.

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