Hello i'm looking for an instruction to do a button which swap between IsolateSelected(null, 1); and IsolateAll(null, 1);
i think i have to use a script similar to this :
var pref = GetValue("preferences.Polygon.planarity" );
SetValue("preferences.Polygon.planarity", !pref, null);
if someone have got something this would be very useful. Thanks
Script button for IsolateSelected and IsolateAll
-
kcsaba
- Posts: 26
- Joined: 01 Jun 2011, 09:42
- Skype: csabakanal
- Location: Budapest/Hungary
Re: Script button for IsolateSelected and IsolateAll
Wouldn't be easier to simply map the commands in the hotkey editor? I have alt f1/f2 works perfect for me.
csk
-
myara
- Posts: 406
- Joined: 28 Sep 2011, 08:33
Re: Script button for IsolateSelected and IsolateAll
I haven't found any way to know if an object has been isolated or a view is isolating something. So you would need to create something to get this info, like a custom property to know when to change from Isolate to Unisolate (IsolateAll).
Now, IsolateSelected works with only one view, so you would need to check what view are you using now, and what view did you use to isolate.
The code wouldn't be 2 lines, but about 30~40 maybe.
A basic code working with only 1 view:
BTW you could use ToggleValue for your planarity code. Apart from being a one line command it doesn't have any advantages though.
Now, IsolateSelected works with only one view, so you would need to check what view are you using now, and what view did you use to isolate.
The code wouldn't be 2 lines, but about 30~40 maybe.
A basic code working with only 1 view:
Code: Select all
var r = ActiveSceneRoot
if (!r.properties("iso") && selection.count >0){
IsolateSelected();
oPSet = r.AddProperty("CustomProperty", 0,"iso");
}
else{
IsolateAll();
if (r.properties("iso")) DeleteObj(r.properties("iso"));
}Code: Select all
ToggleValue("planarity", "preferences.polygon")
M.Yara
Character Modeler | Softimage Generalist (sort of)
Character Modeler | Softimage Generalist (sort of)
-
csaez
- Posts: 253
- Joined: 09 Jul 2012, 13:31
- Skype: csaezmargotta
- Location: Sydney, Australia
Re: Script button for IsolateSelected and IsolateAll
IsolateSelected without anything selected does the same than IsolateAll 
-
myara
- Posts: 406
- Joined: 28 Sep 2011, 08:33
Re: Script button for IsolateSelected and IsolateAll
OMG! thanks!csaez wrote:IsolateSelected without anything selected does the same than IsolateAll
All this time I've been clicking the [X] button.
M.Yara
Character Modeler | Softimage Generalist (sort of)
Character Modeler | Softimage Generalist (sort of)
-
Val_west
- Posts: 2
- Joined: 26 Jul 2013, 14:23
Re: Script button for IsolateSelected and IsolateAll
Thank you. it's working too good.
