用mel编写自定义节点的属性编辑器界面
- // 初始化节点时调用
global proc initControl(string $attrName){// 传进来的参数是节点属性名,使用这个方法获得节点名称string $nodeName = `plugNode $attrName`;setUITemplate -pst "attributeEditorTemplate";button -label "Compute Weight" -c ("cageDeform -init -name " + $nodeName) computeWeightButton;setUITemplate -ppt;}- // 修改节点时(例如点击另一个同类节点)调用
- // 此函数的目的是对按钮绑定的命令做相应修改,使其能应用于相应节点
global proc modifyControl(string $attrName){// 当attrName = “cageDeformer1.noAttr”- // plugNode 命令能够提取节点名字cageDeformer1
string $nodeName = `plugNode $attrName`;print $nodeName;button -e -c ("meshControl -init -name " + $nodeName) computeWeightButton;}- // 函数名同文件名一样,同节点名cageDeformer对应
global proc AEcageDeformerTemplate(string $nodeName){editorTemplate -beginScrollLayout;// 新建一个卷展栏editorTemplate -beginLayout "Weight Scheme" -collapse false;// addControl自动指定合适类型的控件editorTemplate -addControl "maxNeighbourNum";editorTemplate -addControl "weightPower";// 在指定的时机调用前面的函数editorTemplate -callCustom "initControl" "modifyControl" "noAttr";editorTemplate -endLayout;editorTemplate -suppress "outMesh";editorTemplate -suppress "inControlMesh";editorTemplate -suppress "refMesh";editorTemplate -suppress "refControlMesh";editorTemplate -beginLayout "Node Behavior" -collapse true;editorTemplate -addControl "nodeState";editorTemplate -addControl "caching";editorTemplate -endLayout;editorTemplate -addExtraControls;editorTemplate -endScrollLayout;}
Specifies that at this point in the template when building the dialog, the procedure specified by the first argument is to be called to create some UI objects when a new node type is edited. The procedure specified by the second argument is to be called if an attribute editor already exists and another node of the same type is now to be edited. The replacing procedure should connect any controls created by the creating procedure to the equivalent attributes in the new node. A list of zero or more attributes specifies the attributes which the two procedures will involve. The procedures should have the signature:
proc AEcustomNew(string attributeName1, string attributeName2) The number of attributes specified in the call should correspond to the number of attributes in the procedure signature. |
用mel编写自定义节点的属性编辑器界面的更多相关文章
- 流程图GGEditor 之 自定义节点相关属性
自定义节点 注册 -- registerNode 我们通过以下接口往 G6 全局注册节点: // 注册节点 G6.registerNode(name, { // 绘制 draw(item) { r ...
- [翻译] Writing Property Editors 编写属性编辑器
Writing Property Editors 编写属性编辑器 When you select a component in the designer its properties are di ...
- (spring-第13回【IoC基础篇】)PropertyEditor(属性编辑器)--实例化Bean的第五大利器
上一篇讲到JavaBeans的属性编辑器,编写自己的属性编辑器,需要继承PropertyEditorSupport,编写自己的BeanInfo,需要继承SimpleBeanInfo,然后在BeanIn ...
- django “如何”系列4:如何编写自定义模板标签和过滤器
django的模板系统自带了一系列的内建标签和过滤器,一般情况下可以满足你的要求,如果觉得需更精准的模板标签或者过滤器,你可以自己编写模板标签和过滤器,然后使用{% load %}标签使用他们. 代码 ...
- SpringBoot编写自定义的starter 专题
What’s in a name All official starters follow a similar naming pattern; spring-boot-starter-*, where ...
- Fabric Engine2.0的自定义节点功能
Fabric Engine是一个多用途的引擎,针对maya等软件写节点写功能很方便.尤其是canvas节点编辑面板,提供了大量现有的功能供用户调用,当然这些节点功能都是可被用户编辑修改的,除此之外还提 ...
- SpringMVC源码阅读:属性编辑器、数据绑定
1.前言 SpringMVC是目前J2EE平台的主流Web框架,不熟悉的园友可以看SpringMVC源码阅读入门,它交代了SpringMVC的基础知识和源码阅读的技巧 本文将通过源码(基于Spring ...
- 属性编辑器,即PropertyEditor-->Spring IoC
在Spring配置文件里,我们往往通过字面值为Bean各种类型的属性提供设置值:不管是double类型还是int类型,在配置文件中都对应字符串类型的字面值.BeanWrapper填充Bean属性时如何 ...
- Spring经常使用属性的注入及属性编辑器
对于对象的注入,我们使用ref方式,能够指定注入的对象.以下看下对于基本类型的注入.以及当spring无法转换基本类型进行注入时,怎样编写一个相似转换器的东西来完毕注入. 一.基本类型的注入 以下写一 ...
随机推荐
- UIMenuController的使用
1, 基本使用 以对一个UILabel长按弹出菜单为例 子类化UILabel 因为需要覆盖这几个方法:- (BOOL)canBecomeFirstResponder; 返回YES 同时需要在每次UI元 ...
- Vue中class与style绑定
gitHub地址:https://github.com/lily1010/vue_learn/tree/master/lesson07 一 用对象的方法绑定class 很简单,举个栗子: <!D ...
- 模拟Select-Options对象实现多项数据输入功能
模拟Select-Options对象实现多项数据输入功能 Select-Options对象可以同时输入多项值并将所输入数据存入内表以供程序使用,不过Select-Options的功能有一定的局限 ...
- 高性能JS笔记1——加载执行
一.脚本位置 1.Script标签尽可能放到Body底部,以减少脚本文件下载对整个页面UI渲染的影响. 2.Script标签永远不要紧跟Link标签后面. 二.组织脚本 1.合并多个文件在一个Scri ...
- 代码导出Reporting Services报表文件
背景部分 使用Reporting Services很容易制作和发布我们需要的报表,报表效果也还不错 不过如果报表数据过大或报表数量过多,打开及查看报表感觉可能就是另外一回事了 好在Reporting ...
- Level 4 A10: 飞张?
看来庄家的红桃2个输张没法解决,只能寄希望于飞K了. 但如果将牌2-2分布,还有更稳的打法.在下面这种东家3张黑桃的情况时,庄家只需垫到红桃2就行了. 如果东家有4张黑桃,那就只有飞红桃K这一条路了.
- Sharepoint学习笔记—习题系列--70-573习题解析 -(Q77-Q80)
Question 77You have a SharePoint list named Announcements.You have an event receiver that contains t ...
- SharePreference是如何实现的——序列化XML文件
还记得上一篇我们讲到了用SharePreference来存储数据,那么究竟它是如何实现的呢,今天我们就来仔细看看其实现的细节,我们给它一个准确的名字,叫做XML序列化器(XmlSerializer). ...
- 在MAC下搭建JSP开发环境
1.Mac下JDK的下载安装及配置 在安装jdk之后,需要为jdk安装目录配置环境变量: 任意打开终端,默认是家目录的,然后直接输入: touch .bash_profile 然后输入:vi .bas ...
- vs2012远程调试功能的改进
不知道大家有没有遇到过这种情况,刚开发完的程序,明明在本机能够好好的运行,可是部署到服务器过分发给用户时,总是出现莫名其妙的错误. 一时半会又看不出问题来,怎么办呢?难道只能在服务器或是客户电脑上装一 ...