I've run into a frustrating problem with some max script I'm writing and was hoping someone might know why my code isn't working.
I've had success in my same script with other geometry and attach:
fn base = (
base_geo = convertToPoly(Plane length:10 width:10 pos:[0,0,5] isSelected:on lengthsegs:1 widthsegs:1)
base_geo.pivot = [0,0,0]
return base_geo
)
corner_geo = base()
plane1 = base()
--irrelevant rotation + transformation scripts
corner_geo.attach plane1 corner_geo
this works fine
however when I try the same thing later:
fn place_trim x y z trim_type = (
maxOps.cloneNodes trim_type cloneType:#copy newNodes:&cur_group
--convertToPoly(cur_group)
cur_group.pos = [x,y,z]
--not sure how to properly access this name
--print "cur_group name = " + cur_group[1].name
return cur_group
)
fn walls trim_type = (
wall_geo = base()
rotate wall_geo (angleaxis -90 [1,0,0])
plane1 = base()
wall_geo.attach plane1 wall_geo
if trim_type == "inner" do (
trim_type = final_inner_trim
)
if trim_type == "outer" do (
trim_type = final_trim
)
if trim_type != undefined do (
trim = place_trim 0 0 0 trim_type
wall_geo.attach trim wall_geo
)
return wall_geo
)
final_trim = $trim_final
final_inner_trim = $inner_trim_final
walls("outer")
When I reach the bolded section of code I get this error: "--Unable to convert: #($Editable_Poly:trim_final001 @ [0,0,0]) to type: node"
I'd be very grateful for any suggestions on what I'm doing incorrectly!