我在编写一些最大脚本时遇到了一个令人沮丧的问题,希望有人知道我的代码为什么不起作用。
我在与其他几何图形相同的脚本中取得了成功并附加:
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
这很好用
但是,当我稍后尝试相同的事情时:
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 修剪 wall_geo
)
return wall_geo
)
final_trim = $trim_final
final_inner_trim = $inner_trim_final
walls("outer")
当我到达代码的粗体部分时,我收到此错误:“--无法转换:#($Editable_Poly:trim_final001 @ [0,0,0]) 到类型:节点”
对于我做错了什么的任何建议,我将不胜感激!