| View previous topic :: View next topic |
| Author |
Message |
peliosis Houdini Adept
Joined: 30 Jan 2005 Posts: 175

|
Posted: Mon May 28, 2012 4:25 pm GMT Post subject: select script variables |
|
|
I'm trying to setup some script expression using SELECT_NAME, SELECT_PATH, SELECT_SHIFT ... _ALT , _CTRL variables.
Unfortunately I can't even succeed in running:
| Code: | | message $SELECT_NAME |
straight from docs.
It just pops an empty message box.
All of these SELECT_* variables are highlighted red in the editor.
I thought they are no longer supported, but SELECT_PICK actually works.
Getting selected node is obviously not a problem, stardard variables like $OS and expressions (e.g. `opfullpath(".")`) works exactly like expected.
But the thing is I badly need the SELECT_SHIFT, SELECT_ALT and SELECT_CTRL.
first post from eonssss haa !
|
|
| Back to top |
|
 |
edward Houdini Guru

Joined: 04 Jul 2002 Posts: 5005 Location: Toronto

|
Posted: Mon May 28, 2012 7:26 pm GMT Post subject: |
|
|
| Offhand, I can't think of a situation where SELECT_PICK works but not SELECT_NAME/SELECT_PATH. Are you sure? Try surrounding the variables with double quotes. eg. "$SELECT_PATH"
|
|
| Back to top |
|
 |
peliosis Houdini Adept
Joined: 30 Jan 2005 Posts: 175

|
Posted: Tue May 29, 2012 4:01 am GMT Post subject: |
|
|
I'm pretty sure, see attached file.
With SELECT_PICK unset the node is not being selected.
I just can't get SELECT_NAME and SELECT_SHIFT to work
no matter if inside quotes, tildes or without.
These guys work as supposed:
| Code: | message $F
message `$F`
message "$F"
|
For sure I'm making some mistake, but haven't spot it so far.
| Description: |
|
 Download |
| Filename: |
selectScriptTests_01.hipnc |
| Filesize: |
81.23 KB |
| Downloaded: |
66 Time(s) |
|
|
| Back to top |
|
 |
peliosis Houdini Adept
Joined: 30 Jan 2005 Posts: 175

|
Posted: Tue May 29, 2012 12:50 pm GMT Post subject: |
|
|
It gets stranger.
I got to this results via complete accident.
The following script displays an empty message box:
| Code: | | message `$SELECT_NAME` |
The next code displays an empty message box and after that a correct message box, containing a name of selected object.
| Code: | message `$SELECT_NAME`
message `$SELECT_NAME` |
But most surprisingly, the following script displays one, correct message box, containing the name:
| Code: | #message `$SELECT_NAME`
message `$SELECT_NAME` |
This is a partial success.
I'm not sure why it works like that.
Also, with SELECT_SHIFT it doesn't!
Perhaps there is a dark cloaked way of getting it to work?
|
|
| Back to top |
|
 |
peliosis Houdini Adept
Joined: 30 Jan 2005 Posts: 175

|
Posted: Wed May 30, 2012 4:19 pm GMT Post subject: |
|
|
I haven't resolved it.
No progress so far.
How to use SELECT_SHIFT, SELECT_ALT and SELECT_CTRL variables in select script of a node?
Is it actually in use or is it an odd feature?
|
|
| Back to top |
|
 |
peliosis Houdini Adept
Joined: 30 Jan 2005 Posts: 175

|
Posted: Tue Jun 05, 2012 3:38 am GMT Post subject: |
|
|
Looks like writing a script in paramter line yields different results than loading it from file.
After running select script from file, the code from docs actually works
| Code: | | message $SELECT_NAME |
Also | Code: | | message $SELECT_PICK |
returns a message box with a value of 1 (correctly).
But the rest of variables (SELECT_SHIFT etc.) returns an empty message box and an undefined variable error.
At least I know they are not defined.
Does anybody have a clue how to get to them?
|
|
| Back to top |
|
 |
edward Houdini Guru

Joined: 04 Jul 2002 Posts: 5005 Location: Toronto

|
Posted: Sun Jun 17, 2012 12:41 pm GMT Post subject: |
|
|
The pickscript parameter value is first evaluated and then the expanded result is executed. So these variables don't exist until during the execution phase. So you need to escape the dollar signs with backslashes if you're directly typing it as the script value
| Code: | | message \$SELECT_NAME \$SELECT_PICK \$SELECT_SHIFT \$SELECT_CTRL |
This behaves as expected for me.
|
|
| Back to top |
|
 |
|