// The following example creates a couple of objects and places them in a group.
// Then it creates new material in the material library and assigns that material
// to the group. Then it demonstates this command.
// Create a couple of objects
NewScene(null, null);
CreatePrim("Cube", "MeshSurface", null, null);
Translate(null, -7.53782097226927, -0.124316224318551, 1.24316224318551E-02, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
CreatePrim("Cube", "MeshSurface", null, null);
Translate(null, 4.3311236525746, -1.31907686094078E-16, 1.31907686094078E-17, siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
// Create a new material (make it red)
SICreateMaterial(null, null, "Sources.Materials.DefaultLib", "", null, null);
SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.red", 1, null);
SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.green", 0, null);
SetValue("Sources.Materials.DefaultLib.Material.Phong.diffuse.blue", 0, null);
// Assign the new material to the two objects
SelectObj("cube,cube1", null, true);
SIAssignMaterial(null, "Sources.Materials.DefaultLib.Material");
DeselectAll();
// Select the object(s) using the material
SelectObjectsUsingMaterial("Sources.Materials.DefaultLib.Material");
// The objects cube and cube1 should now be selected.
|