Notifications
Clear all

[Closed] condition loop?

Hey there!

I’m not a pro at scripting at all but I have to work something out so I’m hoping you guys could help me out with it ?
I’m trying to make the material dialog and the render setup dialog not available. My solution is to close them everytime someone try to open one of them.

Here’s what I thought about:


 if[i] renderSceneDialog.isOpen[/i]() then[i] renderSceneDialog.close[/i]()
 if[i] MatEditor.isOpen[/i]() then[i] MatEditor.Close[/i]() 

This should work but it’s a command that works one time. How can I make it permanent? from the opening of the max file to its close? Like it will ask if the render and material editors are open every second?
The purpose of this is not be able to check the shaders and render parameters from a .max that I give to someone.

Thank you very much

5 Replies

You can:

  • use a timer that will check each(for example) second for opened windows and will close them
  • check callbacks – I don’t know if they will give you information when the dialogs are open or not, but – check it.

do they have a secret values? or you just don’t want that anyone changes it before/during your function execution?

if i were an artist i would be pretty sad not be able to open and use the material editor

You just can’t do that.

miauu: thanks i’ll check it out! edit: it seems like you cant put a timer on an object… The point is to make the timer starts when the max file is open. any clue?

denisT: no I dont haha I have to give my scene to someone to render it but I don’t want him to be able to copy the shaders and re-use them

PolyTools3D: I’m sure there are ways to make it complicated then

as Jorge said it’s not possible hide a shader settings for sure. but you can make someones life complicated.

using pre-render callback create the shader (or set parameters) on the fly, and using post-render callback delete the shader.

but if someone will ask me how read the shader anyway i know the answer