Announcement

Collapse
No announcement yet.

Python: Finding material end node in C4D 2024

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Python: Finding material end node in C4D 2024

    Hi,

    I'm working on a plugin, which is supposed to generate materials (amongst others) for Vray/C4D.
    I'm using Vray 6.20.01.
    All is nice and dandy in C4D 2023. But in 2024 my code fails to get the end node of a freshly created node material.

    My code looks roughly like so (error checking removed just for this post):
    Code:
    id_nodespace = "com.chaos.class.vray_node_renderer_nodespace"
    id_node_mat = "com.chaos.vray_node.brdfvraymtl"
    id_node_output = "com.chaos.vray_node.Material"   ### Did this change?
    
    mat = c4d.BaseMaterial(c4d.Mmaterial)
    ref_mat_node = mat.GetNodeMaterialReference()
    
    graph = ref_mat_node.CreateDefaultGraph(id_nodespace)
    
    result = []
    maxon.GraphModelHelper.FindNodesByAssetId(graph, id_node_mat, True, result)
    
    result = []
    maxon.GraphModelHelper.FindNodesByAssetId(graph, id_node_output, True, result)
    ### Here I get an empty result list in C4D 2024, while it works as expected in C4D 2023
    ​While I'm also considering this to be a Maxon issue (or change), I do not see this issue with any other render engine I need to support (Arnold, Corona, Octane, Redshift all do work fine in 2024).

    Any help would be much appreciated.
    Thanks in advance,
    Andreas

  • #2
    Hi @andrew_price​ the asset id of our Material end node is "com.chaos.vray_node.mtlsinglebrdf" and should be the same across all V-Ray/Cinema4D versions. You can easily find the asset ids of ports and nodes in the node info by enabling it in preferences.

    Click image for larger version  Name:	image.png Views:	0 Size:	56.3 KB ID:	1203177

    Comment


    • #3
      Hi bozhidar_ivanov,
      thanks a ton. Not only for the provided ID, which is working nicely, but also for the hint that we can enable the ID to be shown in UI. Very helpful, I somehow missed that!
      You can consider this case closed.
      Thanks and cheers

      Comment

      Working...
      X