XSI Howto #1: Symmetrisches Setup für Modelling eines Kopfes

Kaprolactam

Erfahrenes Mitglied
Einfach per Copy and Paste die folgenden Zeilen in den Script Editor packen und ausführen. Dann einfach den Wireframe bearbeiten, die Subdivisions kommen automatisch mit.

Code:
CreatePrim("Cube", "MeshSurface", null, null);
SetValue("cube.polymsh.geom.subdivu", 3, null);
SetValue("cube.polymsh.geom.subdivv", 3, null);
SetValue("cube.polymsh.geom.subdivbase", 3, null);
ActivateEdgeSelTool(null);
SelectGeometryComponents("cube.edge[9,11,13,26,37,45,54,69,78,93,99,104]");
Undo();
PlayRealTime();
PlayForwards();
PlaybackStop();
NewScene(null, null);
CreatePrim("Cube", "MeshSurface", null, null);
SetValue("cube.polymsh.geom.subdivu", 3, null);
SetValue("cube.polymsh.geom.subdivv", 3, null);
SetValue("cube.polymsh.geom.subdivbase", 3, null);
ActivateRaycastPolySelTool(null);
SelectGeometryComponents("cube.poly[24]");
ToggleSelection("cube.poly[1,4,6,21,23,24]", null, true);
ToggleSelection("cube.poly[24]", null, true);
DuplicateMeshComponent("cube.poly[1,4,6,21,23,24]", siPersistentOperation, null, null, null, null, null, null, null, null, null, null, null, null);
Translate(null, 0, -2.6722764167869, 0, siRelative, siGlobal, siObj, siXYZ, null, null, null, null, null);
ActivateEdgeSelTool(null);
SelectGeometryComponents("cube.edge[4,9,11,26,37,45,54,69,78,93,99,104,117,120]");
ApplyTopoOp("SubdivideEdge", "cube.edge[4,9,11,26,37,45,54,69,78,93,99,104,117,120]", siUnspecified, siPersistentOperation);
ActivatePolygonSelTool(null);
DeselectAll();
Undo();
ApplyTopoOp("DeleteComponent", "cube.poly[6,24,58,60-62,69,LAST]", siUnspecified, siPersistentOperation);
SelectGeometryComponents("cube.poly[0,2-4,8-10,13-15,18,19,22,23,26,28,30,31,33-35,38,40,42,43,45,46,48,49,51,52,54,55,63,LAST]");
ApplyTopoOp("DeleteComponent", "cube.poly[0,2-4,8-10,13-15,18,19,22,23,26,28,30,31,33-35,38,40,42,43,45,46,48,49,51,52,54,55,63,LAST]", siUnspecified, siPersistentOperation);
ActivateObjectSelTool(null);
DeselectAll();
CreateLayer("", "", "");
SelectObj("cube", null, true);
MeshSubdivideWithCenter(null, "cube", null, siPersistentOperation);
SetValue("polymsh.polymsh.MeshSubdivideWithCenter.SubdivisionDepth", 2, null);
Clone(null, null, 1, 1, 0, 0, 1, 0, 1, null, null, null, null, null, null, null, null, null, null);
Scale(null, -1, 1, 1, siAbsolute, siParent, siObj, siX, null, null, null);
SelectObj("cube", null, true);
ToggleVisibility("Layers.Layer", "selectability", null);
ToggleVisibility("Layers.Layer_Default", "rendvis", null);
SetValue("Camera.camdisp.mixviewmode", true, null);
SetDisplayMode("Camera", "shaded");
MakeLocal("cube.display", siNodePropagation);
SetValue("cube.display.staticsel", 0, null);
SetValue("cube.display.intsel", 0, null);
SetValue("cube.display.staticunselnear", 0, null);
SetValue("cube.display.intunselnear", 0, null);
SetValue("cube.display.intunselfar", 0, null);

D'ooooh ich hab gerade gemerkt daß ich auf der Arbeit in JScript mitlogge, nicht in VBScript. Hier also die VBScript-Variante:


Code:
CreatePrim "Cube", "MeshSurface"
SetValue "cube.polymsh.geom.subdivu", 3
SetValue "cube.polymsh.geom.subdivv", 3
SetValue "cube.polymsh.geom.subdivbase", 3
ActivateRaycastPolySelTool
SelectGeometryComponents "cube.poly[1,4,6,21,23,24]"
DuplicateMeshComponent "cube.poly[1,4,6,21,23,24]", siPersistentOperation
Translate , 0, -2.63663257672782, 0, siRelative, siGlobal, siObj, siXYZ
ApplyTopoOp "DeleteComponent", "cube.poly[6,24,58,60-62]", siUnspecified, siPersistentOperation
ActivateObjectSelTool
ActivateEdgeSelTool
SelectGeometryComponents "cube.edge[4,9,11,26,37,45,54,69,78,93,99,104,117]"
ApplyTopoOp "SubdivideEdge", "cube.edge[4,9,11,26,37,45,54,69,78,93,99,104,117]", siUnspecified, siPersistentOperation
ActivateObjectSelTool
ActivatePolygonSelTool
SelectGeometryComponents "cube.poly[0,2-4,6,8-10,13-15,18,19,22,23,26,28,30,31,33-35,38,40,42,43,45,46,48,49,51,52,54,55,63]"
ApplyTopoOp "DeleteComponent", "cube.poly[0,2-4,6,8-10,13-15,18,19,22,23,26,28,30,31,33-35,38,40,42,43,45,46,48,49,51,52,54,55,63]", siUnspecified, siPersistentOperation
ActivateObjectSelTool
DeselectAll
CreateLayer
SelectObj "cube", , True
MeshSubdivideWithCenter , "cube", , siPersistentOperation
SetValue "polymsh.polymsh.MeshSubdivideWithCenter.SubdivisionDepth", 2
Clone , , 1, 1, 0, 0, 1, 0, 1
Scale , -1, 1, 1, siAbsolute, siParent, siObj, siX
ToggleVisibility "Layers.Layer_Default", "rendvis"
ToggleVisibility "Layers.Layer", "selectability"
SetValue "Camera.camdisp.mixviewmode", True
SetDisplayMode "Camera", "shaded"
MakeLocal "cube.display", siNodePropagation
SetValue "cube.display.staticsel", 0
SetValue "cube.display.intsel", 0
SetValue "cube.display.staticunselnear", 0
SetValue "cube.display.intunselnear", 0
SetValue "cube.display.intunselfar", 0

/Kapro
 
mit 2.0.1 klappt das script nicht.
in der ersten Zeile beschwert er sich
das man keine klammern benutzen soll,
hab ich sie weggemacht und die zwei
"null" weggemacht damit er ein ende hat
und dann meinte er das er einen bezeichner
in der ersten Zeile braucht.

plz fix it! :)
 
XSI unterstützt doch nicht nur eine Scriptsprache, default ist VBS - der Code ist allerdings eher c-Style, sprich jscript.

File->user preferences->scripting/logging ist dein Freund
 
Und hier kommt die 2.03-Version:

Code:
CreatePrim "Cube", "MeshSurface"
SetValue "cube.polymsh.geom.subdivu", 3
SetValue "cube.polymsh.geom.subdivv", 3
SetValue "cube.polymsh.geom.subdivbase", 3
ActivateRaycastPolySelTool
SelectGeometryComponents "cube.poly[1,4,6,21,23,24]"
DuplicateMeshComponent "cube.poly[1,4,6,21,23,24]", siPersistentOperation
Translate , 0, -3,11300666366565, 0, siRelative, siGlobal, siObj, siXYZ
ActivateObjectSelTool
ActivateEdgeSelTool
SelectGeometryComponents "cube.edge[5,9,11,12,26,37,45,54,69,78,93,99,104,116]"
ApplyTopoOp "SubdivideEdge", "cube.edge[5,9,11,12,26,37,45,54,69,78,93,99,104,116]", siUnspecified, siPersistentOperation
ActivatePolygonSelTool
SelectGeometryComponents "cube.poly[0,2,4,6,8-10,13-15,18,19,21-23,26,28,30,31,33-35,38,40,42,43,45,46,48,49,51-56,58,75,LAST]"
ApplyTopoOp "DeleteComponent", "cube.poly[0,2,4,6,8-10,13-15,18,19,21-23,26,28,30,31,33-35,LAST,40,42,43,45,46,48,49,51-56,58,75,77]", siUnspecified, siPersistentOperation
ActivateObjectSelTool
DeselectAll
CreateLayer
SelectObj "cube", , True
MeshSubdivideWithCenter , "cube", , siPersistentOperation
SetValue "polymsh.polymsh.MeshSubdivideWithCenter.SubdivisionDepth", 2
Instance , , 1, 1, 0, 0, 1, 0, 1
Scale , -1, 1, 1, siAbsolute, siView, siObj, siX
SelectObj "cube", , True
ActivateRaycastPolySelTool
SelectGeometryComponents "cube.poly[3,8,18,24]"
ApplyTopoOp "DeleteComponent", "cube.poly[3,8,18,24]", siUnspecified, siPersistentOperation
ActivateObjectSelTool
ToggleVisibility "Layers.Layer_Default", "rendvis"
ToggleVisibility "Layers.Layer", "selectability"
SetDisplayMode "Camera", "shaded"
MakeLocal "cube.display", siNodePropagation
SetValue "cube.display.staticsel", 0
SetValue "cube.display.intsel", 0
SetValue "cube.display.staticunselnear", 0
SetValue "cube.display.intunselnear", 0
SetValue "cube.display.intunselfar", 0
MakeLocal "cube.display", siNodePropagation
SetValue "cube.display.staticsel", 0
SetValue "cube.display.intsel", 0
SetValue "cube.display.staticunselnear", 0
SetValue "cube.display.intunselnear", 0
SetValue "cube.display.intunselfar", 0
SetValue "Camera.camdisp.mixviewmode", True
DeselectAll
 
Zurück