Selection Scripts
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Selection Scripts
Works on top level scene items.
Buttons to select all items, invert the selection, select lights, cameras and by search name.
forgot to mention, I found that if you have a multiple selection in workspace, modelspace won't see the selection. if one thing is selected then it sees it.
- Attachments
-
- SelectionScripts.RsObj
- (25.46 KiB) Downloaded 190 times
Re: Selection Scripts
Nice!clintonman wrote: ↑08 Aug 2020, 01:58 selectionscripts.jpg
Not sure what I want to add and do with them.
Link Editor Preferences panel would be handy Along with you Alphabetize scripts
Re: Selection Scripts
Is there a way to select 3D Objects Only, excluding Lights and Cameras?
Adding if(Node.IsRenderable(subobj)) is helpful too.
As an example, selecting renderable objects, selects Lights, Cameras, and 3D Objects, and selecting Inverse, selects Non renderable objects.
Also is it possible to add selected objects to your Alphabetize scripts?
IE: Instead of Alphabetizing the whole scene, only selected items in the scene.
I envision a tool that you could reorganize you scene by Lights, Cameras, 3D Objects, and 2D Objects
Adding if(Node.IsRenderable(subobj)) is helpful too.
As an example, selecting renderable objects, selects Lights, Cameras, and 3D Objects, and selecting Inverse, selects Non renderable objects.
Also is it possible to add selected objects to your Alphabetize scripts?
IE: Instead of Alphabetizing the whole scene, only selected items in the scene.
I envision a tool that you could reorganize you scene by Lights, Cameras, 3D Objects, and 2D Objects
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Selection Scripts
3D Objects Only, excluding Lights and Cameras not including group objectstrueBlue wrote: ↑23 Aug 2020, 17:19 Is there a way to select 3D Objects Only, excluding Lights and Cameras?
Adding if(Node.IsRenderable(subobj)) is helpful too.
As an example, selecting renderable objects, selects Lights, Cameras, and 3D Objects, and selecting Inverse, selects Non renderable objects.
Also is it possible to add selected objects to your Alphabetize scripts?
IE: Instead of Alphabetizing the whole scene, only selected items in the scene.
I envision a tool that you could reorganize you scene by Lights, Cameras, 3D Objects, and 2D Objects
Code: Select all
// Execute
// Called to execute the command
function Execute(params)
{
var scene = Space.CurrentScene();
var newSelection = "";
for(var i=0;i<Node.SubObjectCount(scene);i++) {
var subobj = scene + "/" + Node.SubObject(scene, i);
if(!Node.IsLight(subobj) && !Node.IsCamera(subobj) && Node.IsRenderable(subobj))
newSelection += subobj + ";";
}
Space.Select(newSelection);
}
Re: Selection Scripts
Thanks!clintonman wrote: ↑23 Aug 2020, 18:33 3D Objects Only, excluding Lights and Cameras not including group objects
3D Objects Only, excluding Lights and Cameras including group objects
Code: Select all
if(!Node.IsLight(subobj) && !Node.IsCamera(subobj) && Node.ConExists(subobj, "ObjMatrix"))
Re: Selection Scripts
How would you eliminate the Vray and PhotoRender nodes from this selection?
Code: Select all
function Execute(params)
{
var scene = Space.CurrentScene();
var newSelection = "";
for(var i=0;i<Node.SubObjectCount(scene);i++) {
var subobj = scene + "/" + Node.SubObject(scene, i);
if(!Node.ConExists(subobj, "ObjMatrix"))
newSelection += subobj + ";";
}
Space.Select(newSelection);
}
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: Selection Scripts
Something liketrueBlue wrote: ↑24 Aug 2020, 16:11 How would you eliminate the Vray and PhotoRender nodes from this selection?
Code: Select all
function Execute(params) { var scene = Space.CurrentScene(); var newSelection = ""; for(var i=0;i<Node.SubObjectCount(scene);i++) { var subobj = scene + "/" + Node.SubObject(scene, i); if(!Node.ConExists(subobj, "ObjMatrix")) newSelection += subobj + ";"; } Space.Select(newSelection); }
Code: Select all
if(!Node.ConExists(subobj, "ObjMatrix") && Node.SubObject(scene, i) != "Vray" && Node.SubObject(scene, i) != "PhotoRender")