(Deprecated) convertAllMaterialGroups

This example uses API v1. See convertAllMaterialGroups for an example with API v2.

snippets/deprecated/convertAllMaterialGroups.py
 1# © 2024 Autodesk, Inc. All rights reserved.
 2
 3# Converts material group nodes to transform nodes with API v1.
 4
 5nodelist = []
 6def convertMatGroup( node):
 7    if( node.getType() == "MaterialGroup"):
 8        nodelist.append(node)
 9    for i in range(0,node.getNChildren()):
10        convertMatGroup( node.getChild(i))
11    
12def convertAllMatGroups( node):
13    convertMatGroup(node)
14    print(len(nodelist))
15    for i in range(1, len(nodelist)):
16        convertCore(nodelist[i], "Transform3D")