|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| JScript: Closing CustomProperty Window
|
|
|
Dear all,
In JScrip code, I apply Custom Property to some of my models. As my CustomProperties are added to the scene models, they get automatically open. When I batch process several models, it happens that several dozens of Custom Propertiy windows (PPGs?) are open.
Unfortunatelly, I can not find a way how to close an open Custom Property window from within a JScrip code. Any idea, please?
Thank you.
|
|
|
|
The trick I use (as I don’t think you can easily close a PPG programmatically), is to prevent PPGs to pop up during the execution of the script by temporarily altering the corresponding preference value and turning the value back on before the script stops.
Like so:
SetValue("preferences.Interaction.autoinspect", false, ""); [your script]
SetValue("preferences.Interaction.autoinspect", true, "");
The “other” Softimage community: si-community.com
|
|
|
|
|
Hi Hirazi,
that looks like acceptable solution to me. Thank you very much for this, as I’ve alreday been spending several hours finding the answer.
Thanks again, and good luck.
BTW: If anyonw knows the “correct” way of closing open PPGs, I would like to know.
Author: Bunkai.Satori
|
| Replied: 11 February 2011 06:10 AM
|
|
|
|
|
Sorry, there’s no way to close open PPGs.
|
|
|
|
Hello Hirazi and Stephen,
Because I have created C++ based Custom Property, the above solution did not work for me.
Therefore, I created one boolean parameter for the Custom Property command. When the Custom Property PPG is supposed to be displayed while adding it to a scene model, the boolean parameter is set to true or null. When the PPG is supposed not to be displayed, the boolean variable paraameter is set to false.
To be clearer, from within the JScript code I call: MyCustomPropertyName( false );
The rest is controlled within the C++ code.
|
|
|
Bunkai.Satori 11 February 2011 01:05 PM
Dear all,
In JScrip code, I apply Custom Property to some of my models. As my CustomProperties are added to the scene models, they get automatically open. When I batch process several models, it happens that several dozens of Custom Propertiy windows (PPGs?) are open.
Unfortunatelly, I can not find a way how to close an open Custom Property window from within a JScrip code. Any idea, please?
Thank you.
A PPG should only be displayed if you’re using a command to apply the custom property and the user has the user preference set to display PPGs upon node creation.
If you use the object model to apply your custom properties, this will not happen.
Example:
for ( var i = 0; i < Selection.Count; i++ ) {
var oObject = Selection(i);
var oCustomProperty = oObject.AddProperty( "myProperty", false );
oCustomProperty.Name = "myPropertyName"; }
|
|
|
|
|
Hi Mantom,
yes, you are correct that I was using a command to assign custom property. Thank you for your advice.
Regards.
Author: Bunkai.Satori
|
| Replied: 12 February 2011 04:28 AM
|
|
|
|
|
|
|