[request] polyOp

hi

i got a tiny problem with my script

i'm reading parameters out of a *.txt file and i'm using those to create a spline with severals knots.
this spline is converted to a editpoly obj.

well .. within the same script i want to extrude the face i got form the spline/editpoly conversion .. but i allways get an error with the message
"face list out of index .. or something simmilar" ..
the strange thing about it is - if i just do all these steps without the extrusion, and manually adding the same code for extrusion after the script finished .. i dont
get any errors

would be glad about help
cheers
masse

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mambrus's picture

script works now ... thanks

script works now ... thanks once more

mambrus's picture

Thank you! I'll have a try

Thank you!
I'll have a try :)
... maybe I should simply follow the rule that says "never work after 3 a.m." *smile*

cheers
markus (munich/germany)

Marco Brunetta's picture

lol, that's a good rule

lol, that's a good rule =P

cheers

Marco Brunetta's picture

Well seems that the way you

Well seems that the way you are doing it you are not really creating any faces, and so you can't extrude them. What about using an extrude modifier?

pointArray = #([0,0,0],[5,0,0],[5,5,0],[0,5,0],[-5,2.5,0])

fn createPolygons tmpArray =
(
newSplineShape = SplineShape()
addNewSpline newSplineShape
for thePoint in tmpArray DO
(
addKnot newSplineShape 1 #corner #line thePoint
)

newSplineShape.name = (tmpArray[tmpArray.count - 3]) as string

close newSplineShape 1
updateShape newSplineShape

addModifier newSplineShape (extrude height:10)
)

myPoly = createPolygons pointArray

mambrus's picture

fn _createPolygons tmpArray

fn _createPolygons tmpArray =
(
-- the folling pointArray is being filled in
-- original script ... no need for showing you
pointArray = #()

-- create Polygon Object
-- do a spline object 1st
newSplineShape = SplineShape()
addNewSpline newSplineShape
for h = 1 to pointArray.count do
(
addKnot newSplineShape 1 #corner #line pointArray[h]
)

newSplineShape.name = tmpArray[tmpArray.count - 3]

close newSplineShape 1
updateShape newSplineShape

-- convert to Editable Poly
newEditPoly = convertToPoly newSplineShape

-- return
newEditPoly
)

-- -------------------------------------
myPoly = _createPolygon myArray

/*
well ... i wanted to use the newEditPoly to extrude it ... but as I told oyu .. this doesnt work
*/
polyOp.extrudeFaces myPoly #{1} 10.0
-- doesnt work ...

thx for help
masse

Marco Brunetta's picture

Probably some mixup with

Probably some mixup with either the variables or the variable scope. Any chance you can post the code or at least the relevant part?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.