when you select multiple points in an poly.mesh, how do I refer the invididual points in the selection? When script the following: set SelList = GetValue("SelectionList") MsgBox SelList.Count
I get displayed "1" even though 2 points are selected. SelList(0).Name returns "sphere.pnt[19,46]". How can I determine exactly the points 19 and 46 that are selected without parsing the string or by creating a cluster (wastes computational time)?
Also, once I've determined the selected points, how do I manipulate the points (editing their x,y,z values)?
Some of the scripting functions are quite confusing and I think scripting is poorly documented in this version of XSI.
I resorted to just parsing the string (works decently).
And I worked out how to determine the parent of a sub-Component Selection by using ActiveProject.ActiveScene.root.FindChild(name)(0).
Next problem is determining how I can add an edge between two points (not 1 point and a virtual point which is how XSI's current AddEdge command works).
To get the selected points out of pnt[23,25,45,90] I used Split(Split(Split(SelList(0).Value, "[", -1, 1)(1), "]",-1,1)(0), ",", -1, 1)
Less elegant but works well.
Yeah, my main problem was using the object name (of the poly.mesh, not the geometry which is selected) to access the points and hence access their x, y, z co-ordinates. I achieved that by looking at how others did it.
From a point selection (say "pnt[23,45,54]") you can access the object name via SelList(0).Name - where SelList is the SelectionList Object. Then you can use ActiveProject.ActiveScene.root.FindChildren(ObjName)(0) to actually assign your object to a variable, which then allows you to access the geometry.
I'll say it once and I'll say it again, the documentation provided by Softimage isn't terribly good. There are alot of empty spaces and edges aren't even on the object model (which the documentation says there are). Having said that, all Softimage need is a time to mature their product and I'm sure all my concerns are being addressed by them as I type.