RE: Registered command name?

Date : Wed, 1 Aug 2007 12:43:39 -0400
To : <XSI(at)Softimage.COM>
From : "Vincent Fortin" <vincent.fortin(at)ubisoft.com>
Subject : RE: Registered command name?

Stephen,

 

The problem is I don’t want my function names to be “From_Distance” either.

As I said in my previous mail, my function’s name is “UBI_FC_setSeed_fromDistance”. Why is the UI referring to this name at all??? (why not using the ScriptName, at least)

 

If you use a Script Button you have the option to specify a Button Label. But for odd reasons these buttons don’t work inside Menu Buttons.

 

Vincent

 

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Stephen Blair
Sent: Wednesday, August 01, 2007 12:31 PM
To: XSI(at)Softimage.COM
Subject: RE: Registered command name?

 

 

If you do this:

in_reg.RegisterCommand("From Distance", "From_Distance");

then you should get "From Distance" on a toolbar button. I did.

 

 

The command name is also used to name the callback functions such as Execute and Init. For example, the Execute callback for a command named “MyCommand” is “MyCommand_Execute”.

The first character in a command name should be a letter. Subsequent characters can be letters, numbers, underscore (_) characters, or spaces. If a command name contains spaces (for example, "My Simple Command"), then you remove the spaces in the callback function names (for example, "MySimpleCommand_Init" and "MySimpleCommand_Execute").


 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Vincent Fortin
Sent: Wednesday, August 01, 2007 12:08 PM
To: XSI(at)Softimage.COM
Subject: RE: Registered command name?

I think this makes no sense…

 

“The command name (first argument) is used to name the command callback functions such as Execute and Init.”

 

If you’re a coder, you’re likely to end-up with something like this: UBI_FC_setSeed_fromDistance().

Right now if I want user-friendly names on my buttons, I have to use a function name that looks like this: fromDistance() and this will seriously mess with my code readability/organization.

 

I’m sure there’s a way to make my button display “From Distance”.

 

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Vincent Fortin
Sent: Wednesday, August 01, 2007 11:19 AM
To: XSI(at)Softimage.COM
Subject: RE: Registered command name?

 

>…have a look at the code and check you have the second argument, (which is the script name and which is also what will appear in the menu)

Sorry Rob but I’m not getting the behavior you describe. I’m getting the FIRST argument in the menu (this makes no sense).

WTH, anyone?

P/s: It is a self-installed plug-in.

 

 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Robert Moodie
Sent: Wednesday, August 01, 2007 9:59 AM
To: XSI(at)Softimage.COM
Subject: RE: Registered command name?

 

Doing good thanks!

 

 

 

>e.g.

>in_reg.RegisterCommand "VincentWroteThis", "This is a plug-in created by Vincent "

That's exactly my problem... If I go in Customize Toolbar this custom command is listed as "VincentWroteThis", not "This is a plug-in created by Vincent".

Same problem when I drag&drop it in the toolbar.

[Rob] So, assuming the plug-in is a self-installing, have a look at the code and check you have the second argument, (which is the script name and which is also what will appear in the menu)


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.