multi proxy convert

hello again
i made proxy -> mesh
this code is well in 1 select proxy
but if i select multi proxie , that code is error
what problem ~~

rre = #()

for o in selection as array do

(
If classof o == VRayProxy then
(
rre = vrayMeshImport o
select rre
$.pivot = $.center.x,$.center.y,$.min.z]
$.pos = [$.pos.x,$.pos.y,0]
$.transform = o.transform
clearSelection()
delete o
)else()

)

Comments

Comment viewing options

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

...

This code is for you
You have 4 arguments in this FN
- *nodes - selection of vrProxies
- *pivot - place pivot at center, top or bottom (options:#center, #top,#bottom)
- *deleteProxy - remove existing proxies after conversion (options: on or off)
- *placeOnGrid - place mesh on grid (z=0) or keep position (options: on or off)

fn vrProxyToMesh nodes pivot:#center deleteProxy:off placeOnGrid:off = if nodes.count > 0 do
(
	object = for p in nodes where isKindOf p VRayProxy collect p
	if object.count == 0 then messageBox "Select vrProxy Objects!" title:"Warning" beep:off else
	(
		for p in object do
		(
			node = vrayMeshImport p
			node.pivot = case pivot of
			(
				#top: point3 p.pos.x p.pos.y p.max.z
				#bottom: point3 p.pos.x p.pos.y p.min.z
				#center: p.center
			)
			if placeOnGrid do node.pos.z = 0
		)
		if deleteProxy do delete object
	)
)
vrProxyToMesh selection pivot:#bottom deleteProxy:on placeOnGrid:on

bga

dussla's picture

there is problem ~~

i test that ~~~

$.transform = o.transform

that is not accepted~~

can you some fix ~

Comment viewing options

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