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 Get and Set Specific Node Attributes in Maxon Graph API?

    Cinema 4D SDK
    windows python 2025
    3
    3
    533
    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.
    • Amazing_iKeA
      Amazing_iKe
      last edited by

      I've just finished reading the Graph Descriptions Manual, and I now understand how to use dictionaries to create materials. However, I’m not sure how to query a specific attribute of a node.
      Do I need to first find the node's ID?

      In Maya's API, I can do something like this:```
      code_text

      texture_path = cmds.getAttr(file_node + ".fileTextureName")
      

      But in the Maxon API, I don’t know how to get or set a specific property of a node.
      Could you help me understand how to read or modify specific attributes (e.g., texture path or scale) in an existing graph node?

      DunhouD ferdinandF 2 Replies Last reply Reply Quote 0
      • DunhouD
        Dunhou @Amazing_iKe
        last edited by

        Hey @Amazing_iKe,

        As I know Graph Description used to modify graphs but have no methods to get port values.

        You should use maxon.GraphNode, like GetPortValue(), or just use GetValue(''value).

        Cheers~
        DunHou

        https://boghma.com
        https://github.com/DunHouGo

        1 Reply Last reply Reply Quote 1
        • ferdinandF
          ferdinand @Amazing_iKe
          last edited by ferdinand

          Hello @Amazing_iKe,

          Welcome to the Maxon developers forum and its community, it is great to have you with us!

          Getting Started

          Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

          • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
          • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
          • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

          It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: How to Ask Questions.

          About your First Question

          @Dunhou is right, this, querying for values is not possible with graph descriptions at the moment (querying for nodes is possible to some extent) . What you could do, is use a graph query to select some node over its properties, and then just write its ID. ApplyDescription returns the true nodes of a graph sorted over their IDs. Then you could grab that node you are interested in, get the port you want, and write the value based on the existing value. Or you could let graph descriptions be graph descriptions and just use the low level API directly. You can have a look at the Nodes API examples for some inspiration how this lower level API works.

          On of the things I am working on at the moment, is extending the query ability of graph descriptions. What I have implemented so far, is nested queries (you can select nodes over them being connected in a specific way), more query operators (<, >, !=, regex, etc.), and something I dubbed query compositions that allows you to query one node property for more than one value, so that can do stuff like checking if something is smaller than 1, AND bigger than 0, AND not exactly 0.5, or that something matches the regex "$foo." OR "$bar.". What has been also added so far, is a new function called EvaluateQuery which allows you to run queries without having to apply a description. But this function also operates on the level that it will return nodes, and not ports or even values.

          I of course also have thought about this, querying for values directly, but I have not implemented it for now, as you can do it somewhat easily yourself with EvaluateQuery (and to some extent even with ApplyDescription) by just getting the port and then its value. But I understand the alure, maybe when I have time, I will fit in a EvaluateValueQuery. The update was planned for one of later 2025.X releases, but at the moment it looks more like that it will be 2026.0.0.

          When you need help with the lower level Nodes API, just open a posting here on the forum with what you got.

          Cheers,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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