[Closed] align plane to slice modifier
Hi everybody,
I would like to align a plane to a slice modifier that is on a object. Unfortunate i am not able to place the plane on the slice, its being placed on [0,0,0], probaly because the slice is in local coordinates and i need to get the world coordinates, i think.
The other way around i had succes, align the slice to a plane, the code for that is standing below. If somebody could help me aligning a plane to a slice, i would appreciate it alot.
clearlistener()
slicer_pos_rot $box001 $plane001 $box001.modifiers[1]
fn slicer_pos_rot segment extern_snijvlak segment_mod =
(
c = extern_snijvlak.transform
objTM = segment.objectTransform
segment_mod.slice_plane.transform = c * (inverse objTM)
)
code worked like this here:
It moved the slice plane to where the plane object is located.
Do you want it to work this way – or the other way around?..
I moved the function call to below your function definition.
like this:
clearlistener()
fn slicer_pos_rot segment extern_snijvlak segment_mod =
(
c = extern_snijvlak.transform
objTM = segment.objectTransform
segment_mod.slice_plane.transform = c * (inverse objTM)
)
slicer_pos_rot $box001 $plane001 $box001.modifiers[1]
it moves the slice plane to where the plane object is located.
(I added slice modifier to box001, created a plane object, ran the code).
Hi stigatle,
Thank you for your message, but I need it to work the other way around