سؤال

I am writing a plugin for 3ds MAX 2013. In my plugin I need the user to add some "User Defined" properties in the "Object Properties" window of a "mesh / camera / light". After entering the values I need to validate some conditions in the data, and if there are some errors I need to show a message box and cancel closing of the "Object Properties" window.

Using NOTIFY_PRE_NODE_USER_PROP_CHANGED and NOTIFY_POST_NODE_USER_PROP_CHANGED I was able to validate the conditions and show the error messages. How will I stop the closing of the window after showing the error message?

In the maxsdk for 3ds MAX 2013, In the TabDialogMessages enum I find a flag "TABDLG_PRECOMMIT" which seems to do what I need. But how can I use this flag for "Object Properties" window. If I can use this how will I get the handle of the editbox in the "User Defined" tab of "Object Properties" window.

هل كانت مفيدة؟

المحلول

Unfortunately, I think this is impossible. The main issue with what you are trying to do is actually getting the IP once the properties dialog is displayed. There is no way (AFAIK) of affecting the dialog before it is posted, and no way of getting the instruction pointer after. If you could figure that out, you could SubClass the DlgProc and intercept the OkToCommit call to do your validation.

What you could do instead though would be to validate the properties, and if they are not appropriate re-post the dialog immediately using 'actionMan.executeAction 0 "40022" -- Edit: Properties'. The user would see the dialog dissappear, and reappear immediately. Its not perfect, but it's something.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top