uvwmap gizmo to ojbect center

i made uvwmap and some moved gizmo

i would like to uvwmap gizmo -> object center again

always thank you for good script and good advice ~

Comments

Comment viewing options

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

.

OK, it did actually work.

If I have an Edit Poly modifier, and run resetEPM_SlicePlane(), the max listener outputs "0"
If I run it on Editaple Poly, the output is "undefined".

New Suggestion:
Align Slice plane to poly face. I tried using Normal Align tool, but it doesnt work on a gizmo :(

Kind regards
Haider
www.haider.se

barigazy's picture

...

fn will always returns what is executed last.

bga

barigazy's picture

...

Check abain *resetEPM_SlicePlane* fn. I tested it on 50 selected objects that not have Edit_Poly modifier (EPoly Objects) and with EP Modifier and it works fine

bga

barigazy's picture

...

@If I modify the control points, and fiddle with the Set Volume, resetModyGizmoTm will reset everything, not only the Lattice position but also the shape.Why is that?

because of this

resetLattice mody

bga

barigazy's picture

...part3 (FFD support)

fn getMody node modyClass: = if node.modifiers.count > 0 do
(
	local mody
	for m in node.modifiers while mody == undefined where iskindof m modyClass do mody = m ; mody
)
mapped fn resetModyGizmoTm nodes whichClass: center: = if isValidNode nodes do
(
	mody = getMody nodes modyClass:whichClass
	if mody != null and validModifier nodes mody do
	(
		tm = if center then (translate (matrix3 1) (in coordsys nodes.objecttransform nodes.center)) else (matrix3 1)
		case of
		(
			(isProperty mody #lattice_transform) : (resetLattice mody ; mody.lattice_transform = tm)
			(isProperty mody #gizmo) : mody.gizmo.transform = tm
			(isProperty mody #slice_plane) : mody.slice_plane.transform = tm
		)
	)
)

bga

Haider of Sweden's picture

.

Great work!

When I tried some other modifier, like taper:
resetModyGizmoTm selection whichClass:Taper
... it worked fine (although; I wonder why the gizmo didnt center properly - could you see and explain?)

But for the slice, there was no effect. Can you explain why?

Furthermore, if one wants to develop the script further, for example add support for FFD_2x2x2 which has "lattice" gizmos, should I add new rows like:
(isProperty mody #FFD_2x2x2) : mody.lattice.transform = (translate (matrix3 1) (in coordsys nodes.objecttransform nodes.center))

What about the "set volume" sub object, what should it be called?

ps. just half-off-topic. How do I wrap code in the way you do, so it has a frame aound it? I tried both code and blockcode with no luck..

Kind regards
Haider
www.haider.se

barigazy's picture
barigazy's picture

...

I not tested the code for every modifier class. I only post an example how can be done. Feel free to modify my snippet to suit your need and if you are "stuck" somewhere post your code here. Then we can try to find another solution.

bga

Haider of Sweden's picture

.

Thanks.

- These examples are compatible, but can you please explain why the gizmo placement moves up after centering?

resetModyGizmoTm selection whichClass:Twist
resetModyGizmoTm selection whichClass:Taper

- I understand why the slice didnt work, a small misspelling: "slice_slane" should be "slice_plane"

- I understand that if I want to more subObject items, like "lattice", I add:

(isProperty mody #lattice) : mody.lattice.transform = (translate (matrix3 1) (in coordsys nodes.objecttransform nodes.center))

... but what should I type for e.g. "Set Volume" subobject in FFD 2x2x2?

- Previously, you said "alternatively you can change i.center[3] to 0". Can you please explain the difference?

- Can this be used for Editable Polygon > Slice Plane?

Kind regards
Haider
www.haider.se

barigazy's picture

...

@Can this be used for Editable Polygon - Slice Plane?
No. EPoly Slice plane use different concept ei.methods.

bga

Comment viewing options

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