MaxScript:什么“回调类型名称”?当节点更改类型/类时将用于触发回调?

发布于 2024-11-13 13:31:57 字数 241 浏览 2 评论 0原文

我的 MaxScript 工具要求场景对象的类型为 editable_mesh 或 editable_poly,并且根据对象类型启用和禁用 GUI 控件。

使用 #selectionSetChanged 回调,当用户更改所选对象时,我可以成功更新卷展栏,但如果他们转换对象,他们将被迫取消选择它并再次选择它以对其进行操作。

我应该向callbacks.addscript提供什么回调类型名称,以便在用户更改/转换对象的类型/类时调用它?

My MaxScript tool requires a scene object to be of the type editable_mesh or editable_poly, and depending on the object type will enable and disable GUI controls.

Using the #selectionSetChanged callback I can have my rollout update successfully when the user changes the selected object, but if they convert an object they are forced to deselect it and select it again to operate on it.

What callback type name should I supply to callbacks.addscript, in order for it to be called when the user changes/converts the type/class of an object?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何止钟意 2024-11-20 13:31:57

通过调用 NodeEventCallback 使用节点事件系统,并将我的函数提供给modelstructed 财产。

它在标准事件回调系统之上运行一个层,并具有许多新事件,但它仅适用于 3ds Max 2009 及更高版本。

Used the Node Event System by calling NodeEventCallback and provided my function to the modelstructured property.

This operates a layer over the standard event callback system and has a number of new events, however it is only available for 3ds Max 2009 and above.

与往事干杯 2024-11-20 13:31:57

据我所知,没有这样的回调事件,甚至当构造在这里也不起作用。实现这一目标的一种方法是在卷展栏中使用计时器,并在每次勾选时检查所选对象的类/超类,但我不确定它是否确实需要。

如果你想警告用户该对象需要转换,有很多方法可以在他的配合下完成,例如在选择时弹出一个查询框,上面会显示类似“单击的对象不是可编辑网格”之类的内容。将其转换为一个?”或带有选项转换为可编辑多边形/转换为可编辑网格/丢弃的自定义查询框。

或者甚至是老式的方式,默认情况下禁用所有有问题的控件,只启用一个大的“选择节点”选择按钮。该节点将提供一个过滤器功能,仅允许您选择可编辑的节点。

There's no such a callback event that I'm aware of, not even a when construct would work here. One way to accomplish that would be to use a timer in the rollout and on each tick check the class/superClass of the selected object/s but I'm not sure it's actually needed in the first place.

If you want to warn the user that the object needs to be converted, there are many ways to do it with his cooperation, like popping up a queryBox on select that would say something like "Clicked object is not an Editable Mesh. Convert it to one?" or a custom querybox with options Convert to Editable Poly/Convert to Editable Mesh/Discard.

Or even the old-fashioned way, having all the controls in question disabled by default, only a big Pick Node pickbutton enabled. That one would have been supplied with a filter function that would only let you pick editable node(s).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文