Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / JScript: Closing CustomProperty Window
  RSS 2.0 ATOM  

JScript: Closing CustomProperty Window
Rate this thread
 
52242
 
Permlink of this thread  
avatar
  • Total Posts: 101
  • Joined: 31 August 2010 07:17 AM

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.



Replies: 0
avatar

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

Replies: 1
/img/forum/dark/default_avatar.png

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  
avatar

Sorry, there’s no way to close open PPGs.



Replies: 0
avatar

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.



Replies: 0
avatar
  • mantom
  • Posted: 11 February 2011 01:26 PM

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 0Selection.Counti++ ) {

   
var oObject Selection(i);
   var 
oCustomProperty oObject.AddProperty"myProperty"false );
   
oCustomProperty.Name "myPropertyName";
}


Replies: 1
/img/forum/dark/default_avatar.png

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