WIP python script: Isolate Tool

   6209   7   1
User Avatar
Member
12 posts
Joined: July 2013
Offline
Hiya,

I've been working on a python script, which allows the user to isolate an object ( hiding all other objects ).

The difference between this script and the tool from “download shelf” one, is that this one keeps in memory ( by a simple .tmp file in $TMP folder), which objects were displayed or hidden before the isolate process.
Like that, when you exit isolate mode, not every objects will be displayed again but the only the nodes displayed before.

The script is still WIP, any bugs or errors, let me know ( only tested on windows 7 for the moment).

How to use:

- Copy the .py file in “C:\Program Files\Side Effects Software\Houdini XX.X.xxx\python26\lib” or whatever python folder used by Houdini
- Create a new tool in a shelf: Right-clic -> new tool
- In tab “Script” write these two lines:

import IsolateSelection
reload(IsolateSelection)

Select an object to isolate that object by a clic on the tool just created, clic again the tool to display back all other nodes.

Thanks,
Guillaume

Attachments:
IsolateSelection.zip (2.0 KB)

User Avatar
Member
284 posts
Joined:
Online
Instead of using /tmp for your object information you could also store it on the Python hou.session module. Just assign like thus:

hou.session.isolateNodePaths =

This information isn't saved with the scene, but if you wanted it to persist you could use hou.appendSessionModuleSource:

http://www.sidefx.com/docs/houdini12.5/hom/independent [sidefx.com]
http://www.sidefx.com/docs/houdini12.5/hom/hou/appendSessionModuleSource [sidefx.com]
User Avatar
Member
12 posts
Joined: July 2013
Offline
Cool thank you ! it's what I was looking for
User Avatar
Member
183 posts
Joined: Nov. 2008
Offline
That should be much easier Take a look at my solution:
http://pastebin.com/YiCC0kSB [pastebin.com]
Put it on shelf or hou.session, select a couple of objects and call isolate().
If selection is empty - all objects became visible.
8)
Aleksei Rusev
Sr. Graphics Tools Engineer @ Nvidia
User Avatar
Member
655 posts
Joined: Feb. 2006
Offline
Aren't you assuming all the objects were visible? does seem a bit optimist assumption.

I rather prefer a foolproof version that takes no assumptions if possible.

am I missing something?

Stalkerx777
That should be much easier Take a look at my solution:
http://pastebin.com/YiCC0kSB [pastebin.com]
Put it on shelf or hou.session, select a couple of objects and call isolate().
If selection is empty - all objects became visible.
8)
User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
It works in object level even if some objects are hidden. It doesn't unhide all objects but restore visibility to previous state.
User Avatar
Member
12 posts
Joined: July 2013
Offline
Yes , I store in a list which objects were or were not hidden, and switch back the display flag according to that.
The list lives in the current session only of course.
User Avatar
Member
655 posts
Joined: Feb. 2006
Offline
Makes sense.. thanks
  • Quick Links