hah, i wish it was clear to me
battling to make this silly proxy button for the last hour!
i grabbed some code from my v-motion scripts, and made it a lot more complicated than it should be
i managed to make it work, only that it makes the original frost the edit mesh, and creates a copy of this, not so good
global Frost_Explorer_Dialog
try(destroyDialog Frost_Explorer_Dialog)catch()
rollout Frost_Explorer_Dialog "FROST Explorer"
(
local cloneCollection
fn CloneAndSelect objArray type = (
currObjs = objects.count
case type of (
1: copy objArray
2: instance objArray
3: reference objArray
)
newObjs = for i = (currObjs+0) to objects.count collect objects[i]
select newObjs
)
local theFrosts = #()
multilistbox lbx_frostObjects "Frost Objects in the Scene:" height:10
checkbox chk_onInVpt "View" align:#right across:3
checkbox chk_onInVpt2 "Rndr" align:#right
checkbox chk_onUpdate "Rfrsh" align:#right
label lbl_space ""
spinner spn_mesh "Mesh Type:" range:[1,6,3] fieldwidth:40 type:#integer align:#right
spinner spn_radius "Particle Radius:" range:[0,10000,5.0] fieldwidth:40 type:#worldunits align:#right
spinner spn_blendRadius "ZB Blend Radius:" range:[0,100,1.7] fieldwidth:40 type:#float align:#right
label lbl_space2 ""
spinner spn_ATscale "AT Scale Radius:" range:[0,100,0.5] fieldwidth:40 type:#float align:#right
spinner spn_ATsurface "AT Surface Level:" range:[0,100,0.5] fieldwidth:40 type:#float align:#right
spinner spn_ATstretch "AT Stretch:" range:[0,100,4] fieldwidth:40 type:#float align:#right
spinner spn_ATneighbors "AT Neighbors:" range:[0,100,25] fieldwidth:40 type:#integer align:#right
spinner spn_ATsmoothing "AT Smoothing:" range:[0,100,0.9] fieldwidth:40 type:#float align:#right
label lbl_space3 ""
spinner spn_render "Render Resolution:" range:[0,100,1.7] fieldwidth:40 type:#float align:#right
spinner spn_viewport "Viewport Resolution:" range:[0,100,1.7] fieldwidth:40 type:#float align:#right
--spinner objCount "" range:[1,10000,50] type:#integer width:42 toolTip:"Proxy Count" across:3 align:#left
--radiobuttons clonetype labels:#("C","I","R") align:#left across:2 width:200 default:2
button btnProxy "Proxy" align:#right width:60 height:38 toolTip:"Create Frost Proxies"
fn getSelectedFrosts =
(
(for i in lbx_frostObjects.selection collect theFrosts[i])
)
fn updateControls =
(
local theSelectedFrosts = getSelectedFrosts()
local enableInViewport = 0
local enableInRender = 0
local updateOnParticleChange = 0
local particleRadius = 0
local blendRadius = 0
local meshingType = 0
local scale1 = 0
local surface1 = 0
local stretch1 = 0
local neighbor = 0
local smoothing = 0
local renderMeshingResolution = 0
local viewportMeshingResolution = 0
for o in theSelectedFrosts do
(
if o.enableViewportMesh do enableInViewport+=1
if o.enableRenderMesh do enableInRender+=1
if o.updateOnParticleChange do updateOnParticleChange +=1
if o.meshingMethod > meshingType do meshingType = o.meshingMethod
if o.Radius > particleRadius do particleRadius = o.Radius
if o.zhuBridsonBlendRadiusScale > blendRadius do blendRadius = o.zhuBridsonBlendRadiusScale
if o.anisotropicRadiusScale > scale1 do scale1 = o.anisotropicRadiusScale
if o.anisotropicIsosurfaceLevel > surface1 do surface1 = o.anisotropicIsosurfaceLevel
if o.anisotropicMaxAnisotropy > stretch1 do stretch1 = o.anisotropicMaxAnisotropy
if o.anisotropicMinNeighborCount > neighbor do neighbor = o.anisotropicMinNeighborCount
if o.anisotropicPositionSmoothingWindowScale > smoothing do smoothing = o.anisotropicPositionSmoothingWindowScale
if o.renderMeshingResolution > renderMeshingResolution do renderMeshingResolution = o.renderMeshingResolution
if o.viewportMeshingResolution > viewportMeshingResolution do viewportMeshingResolution = o.viewportMeshingResolution
)
chk_onInVpt.triState = case of
(
(enableInViewport == theSelectedFrosts.count) : 1
(enableInViewport == 0) : 0
default: 2
)
chk_onInVpt2.triState = case of
(
(enableInRender == theSelectedFrosts.count) : 1
(enableInRender == 0) : 0
default: 2
)
chk_onUpdate.triState = case of
(
(updateOnParticleChange == theSelectedFrosts.count) : 1
(updateOnParticleChange == 0) : 0
default: 2
)
spn_mesh.value = meshingType
spn_radius.value = particleRadius
spn_blendRadius.value = blendRadius
spn_ATradiusScale.value = scale1
spn_ATsurface.value = surface1
spn_ATstretch.value = stretch1
spn_ATneighbors.value = neighbor
spn_ATsmoothing.value = smoothing
spn_render.value = renderMeshingResolution
spn_viewport.value = viewportMeshingResolution
)
on chk_onInVpt changed state do
(
for o in getSelectedFrosts() do o.enableViewportMesh = state
updateControls()
)
on chk_onInVpt2 changed state do
(
for o in getSelectedFrosts() do o.enableRenderMesh = state
updateControls()
)
on chk_onUpdate changed state do
(
for o in getSelectedFrosts() do o.updateOnParticleChange = state
updateControls()
)
on spn_mesh changed val do
(
for o in getSelectedFrosts() do o.meshingMethod = val
)
on spn_radius changed val do
(
for o in getSelectedFrosts() do o.Radius = val
)
on spn_blendRadius changed val do
(
for o in getSelectedFrosts() do o.zhuBridsonBlendRadiusScale = val
)
on spn_ATscale changed val do
(
for o in getSelectedFrosts() do o.anisotropicRadiusScale = val
)
on spn_ATsurface changed val do
(
for o in getSelectedFrosts() do o.anisotropicIsosurfaceLevel = val
)
on spn_ATstretch changed val do
(
for o in getSelectedFrosts() do o.anisotropicMaxAnisotropy = val
)
on spn_ATneighbors changed val do
(
for o in getSelectedFrosts() do o.anisotropicMinNeighborCount = val
)
on spn_ATsmoothing changed val do
(
for o in getSelectedFrosts() do o.anisotropicPositionSmoothingWindowScale = val
)
on spn_viewport changed val do
(
for o in getSelectedFrosts() do o.viewportMeshingResolution = val
)
on spn_render changed val do
(
for o in getSelectedFrosts() do o.renderMeshingResolution = val
)
on lbx_frostObjects selected itm do
(
local theSel = lbx_frostObjects.selection as array
if theSel.count == 0 then
max select none
else
select (for i in theSel collect theFrosts[i])
updateControls()
)
on Frost_Explorer_Dialog open do
(
theFrosts = for o in objects where classof o.baseobject == Frost collect o
lbx_frostObjects.items = for o in theFrosts collect o.name
)
on btnProxy pressed Do
(
objs = selection as array
if objs.count > 0 do
(
num = 3
type = 1
objArray = #()
for c = 2 to (num-1) do (
CloneAndSelect objs type
join objArray objs --(getCurrentSelection())
)
--insertItem objs objArray 1
--select objArray
convertToMesh objArray
)
--cloneCollection = objArray
--select objArray
)
)
createDialog Frost_Explorer_Dialog 170 500
this the new frost explorer
and here is the code i had to produce to get it working!
[code]local cloneCollection
fn CloneAndSelect objArray type = (
currObjs = objects.count
case type of (
1: copy objArray
2: instance objArray
3: reference objArray
)
newObjs = for i = (currObjs+0) to objects.count collect objects[i]
select newObjs
)[/code]
--spinner objCount "" range:[1,10000,50] type:#integer width:42 toolTip:"Proxy Count" across:3 align:#left
--radiobuttons clonetype labels:#("C","I","R") align:#left across:2 width:200 default:2
button btnProxy "Proxy" align:#right width:60 height:38 toolTip:"Create Frost Proxies"
[code] on btnProxy pressed Do
(
objs = selection as array
if objs.count > 0 do
(
num = 3
type = 1
objArray = #()
for c = 2 to (num-1) do (
CloneAndSelect objs type
join objArray objs --(getCurrentSelection())
)
--insertItem objs objArray 1
--select objArray
convertToMesh objArray
)
--cloneCollection = objArray
--select objArray
)
)[/code]
i can hear you laughing already