Jump to content

hscript op selection


David Gary

Recommended Posts

Hi

This is not a question about Vex but hscript. And since it's the coders corner...

(what about creating a dedicated hscript section in the forum? ).

I'm looking for a simple way to get the list of the currently selected objects.

I found somewhere in the codex section a script using the opselect function .

But this function is not listed in the manuals and doesn't exist anymore ( i'm

using H6)

All i can do for the moment is query the -p flag with opget but it returns a

long code.

There must be an easy way to do that

Any help appreciated. :)

What do you think about the minimalistic textport? Is there a way to launch a decent text editor. :angry:

Has such a thing already been written. ( i'm on Windows...)

Link to comment
Share on other sites

yeah, someone did write a better textport... you may find it in the codex section.

as far as opselect, it works fine for me. You may be thrown off by the fact that it's an expression, not a command. so in a textport try:

echo `opselect("/obj")`

and you should get a list of selected objects.

Cheers!

-J

Link to comment
Share on other sites

Yeah, I have no idea why some things are expressions and some things aren't. Interestingly enough you can run expressions in hscript by surrounding it with ` , and you can use hscript commands in expressions by using the execute() expression.

Here's a funny bit:

Director -> exhelp execute

string execute (string command)

This expression will execute the given houdini command (enclosed in

quotes)

eg. execute("list") is the same as typing list in the text port

----

Director -> list

Unknown command: list

Oh those silly sidefx guys.

-J

P.S. I attached a hipfile that uses opselect in an expression. You gotta hit play to see it work. Just select any one of the boxes on object level.

opselect.hip.gz

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...