So this script language is somehow crazy for me to understand. I got something dong something though, which was exciting. I’m hoping someone with deeper knowledge can help me get this working properly.
The goal is to move all subtools by an x-offset derived from the selected subtool when the script is triggered. Suonds prettysimple, but I’m getting strange issues when setting the position with this line:
[ISet, Tool:Geometry:X Position, #Newpos]
Sometimes is seems to applya different value from the UI - odd indeed.
Anyone who has a moment and wants to see if they can help me would get virtual cookies.
Script is just this:
[IButton,“Zplugin:cwtools:recentre”,“recentre subtools x”,
[If, [IGet, Transform:Edit],
//get current subtool position as centre
[VarDef, NewCentreOffset, 0]
[VarDef, ThisCentre, 0]
[VarDef, SetPosition, 0]
[VarDef, Thispos, 0]
[VarDef, Newpos, 0]
[VarSet, NewCentreOffset, [IGet,Tool:Geometry:X Position]*-1]
[note, [StrMerge,"offset for current subtool: ",NewCentreOffset, " subtoolpos: ",[IGet,Tool:Subtool:X Position]]]
[Loop,[SubToolGetCount], [If,[Val,n]==0,[SubToolSelect,1],[SubToolSelect,0]] [SubToolSelect,[Val,n]] [VarSet, Thispos, [IGet,Tool:Geometry:X Position]] [VarSet, Newpos, Thispos+NewCentreOffset] [ISet, Tool:Geometry:X Position, #Newpos] ,n]
[SubToolSelect,0]
] // Not a 3D object
]
cheers!