select script variables

   4577   6   1
User Avatar
Member
175 posts
Joined: 7月 2005
Offline
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:
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 !
User Avatar
Member
7871 posts
Joined: 7月 2005
Offline
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”
User Avatar
Member
175 posts
Joined: 7月 2005
Offline
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:
message $F
message `$F`
message “$F”


For sure I'm making some mistake, but haven't spot it so far.

Attachments:
selectScriptTests_01.hipnc (81.2 KB)

User Avatar
Member
175 posts
Joined: 7月 2005
Offline
It gets stranger.
I got to this results via complete accident.

The following script displays an empty message box:
message `$SELECT_NAME`

The next code displays an empty message box and after that a correct message box, containing a name of selected object.
message `$SELECT_NAME`
message `$SELECT_NAME`

But most surprisingly, the following script displays one, correct message box, containing the name:
#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?
User Avatar
Member
175 posts
Joined: 7月 2005
Offline
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?
User Avatar
Member
175 posts
Joined: 7月 2005
Offline
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
message $SELECT_NAME
Also 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?
User Avatar
Member
7871 posts
Joined: 7月 2005
Offline
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

message \$SELECT_NAME \$SELECT_PICK \$SELECT_SHIFT \$SELECT_CTRL

This behaves as expected for me.
  • Quick Links