V2 API에서 재질 작업을 할 때는 재질과 재질 노드 간의 차이점을 이해하는 것이 중요합니다. vrdMaterial은 vrdNode에서 파생된 것이 아니므로 장면 그래프에 나타나지 않습니다.
이 옵션은 vrdNode에서 파생되는 라이트 또는 카메라와는 다릅니다. 이 차이는 UI에서 직접 표시되지 않습니다. 재질 편집기는 재질을 계층 그래프 구조로 표시합니다. 그러나 이 시각적 표현은 실제 구조를 반영하지 않습니다.
재질 편집기 그래프에는 vrdMaterialNodes가 있습니다. 이러한 노드에는 실제 재질이 포함됩니다.
이를 보여 주기 위해 다음 예제에서는 그룹 및 플라스틱 재질을 만든 다음 그룹 아래에서 재질을 이동합니다. 또한 그룹을 먼저 만들고 createMaterial()에서 materialGroup 매개변수로 사용할 수 있습니다.
Move a material under group
# Create the material
mat1 = vrMaterialService.createMaterial("plastic1", vrMaterialTypes.Plastic)
# Create the group (it will automatically get a unique name, but we rename it afterwards)
group1 = vrMaterialService.createMaterialGroup()
group1.setName("matgroup")
# Access the vrdMaterialNode that has been automatically created for the plastic material
mat1Node = vrMaterialService.findMaterialNode(mat1)
# Hierarchy modifications on vrdNodes are done by manipulating it's children class member
group1.children.append(mat1Node)
# Now the material will appear under the group. We can also move it back out to the top level
vrMaterialService.getMaterialRoot().children.append(mat1Node)
그룹 노드의 계층 작업은 해당 하위 클래스 구성원을 조작하여 수행할 수 있습니다. 자세한 내용은 vrdNodeList를 참조하십시오.