Help a noob pls

Help a noob pls

Anonymous
Not applicable
245 Views
2 Replies
Message 1 of 3

Help a noob pls

Anonymous
Not applicable
Hi guys I've been sitting here fixing my script and can no longer see the forest for the trees.
The following code uses two radiobutton to decide to freeze or unfreeze planes
and I can get it freeze them but when I add more code to unfreeze them I get errors
could someone be kind enough to point me in the right direction.......
before I take a chainsaw to those bloody trees :(
Thanks Luke


on freezeMe pressed do
(
MyArray = ($*_Plane as array)
for i = 1 to MyArray.count do
(
if fFreeze.state == 1 then
select $*_Plane
freeze $*_Plane
else
if fFreeze.state == 2 do
actionMan.executeAction 0 "283" -- Tools: Unfreeze All
unfreeze objects
)
)
0 Likes
246 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Hi guys I've been sitting here fixing my script and can no longer see the forest for the trees.
The following code uses two radiobutton to decide to freeze or unfreeze planes
and I can get it freeze them but when I add more code to unfreeze them I get errors
could someone be kind enough to point me in the right direction.......
before I take a chainsaw to those bloody trees :(
Thanks Luke


on freezeMe pressed do
(
MyArray = ($*_Plane as array)
for i = 1 to MyArray.count do
(
if fFreeze.state == 1 then
select $*_Plane
freeze $*_Plane
else
if fFreeze.state == 2 do
actionMan.executeAction 0 "283" -- Tools: Unfreeze All
unfreeze objects
)
)



there are several comments to your script:
#1.
if freezeMe is RadioButton control it can have only two event handlers - on <> changed , and on <> rightclick &#40;max 2010+&#41;
so, your code might look like:

on freezeMe changed state do undo "Freeze State" on case state of
&#40;
1: freeze &#36;*_Plane
2: unfreeze &#36;*_Plane
&#41;

#2.
your code has to toggle freezing state of *_plane&#40;s&#41;. In this case is better to use simple button with toggle functionality &#40;use easy press for freezing and rightClick for unfreezing&#41;:

on freezeMe pressed do undo "Freeze" on freeze &#36;*_Plane
on freezeMe rightClick do undo "UnFreeze" on unfreeze &#36;*_Plane


Why simple button is better? Because in case of RadioButtons, CheckBox or CheckButton your have to care about the matching of freezing state of the planes and the state of the control. Which is not simple.
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks a lot great advice. I'd closed my mind to using another method lol
your suggestion worked

Luke
0 Likes