用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无法转换基本类型进行注入时,怎样编写一个相似转换器的东西来完毕注入. 一.基本类型的注入 以下写一 ...
随机推荐
- .NET WinForm画树叶小程序
看了一片文章(http://keleyi.com/a/bjac/nurox416.htm),是使用分型画树叶,代码是Java的,因为Java很久没弄了,改用C#实现,下载地址: 画树叶小程序下载 核心 ...
- ES6的Class
类的基本写法: constructor构造函数其实就相当于ES5中的构造函数,用于定义类的实例属性: 而在类中定义的其他方法像这里的toString方法就相当于ES5中定义在原型prototype上的 ...
- 自定义SharePoint 2013 元数据选择控件
元数据在Sharepoint中是一个很常用的功能,他提供一个方法来管理企业中常用的关键词,可以更加统一的使用和更新.默认情况下,绑定在列表或库中的元数据字段可以设置是否允许为多个值.但是无法控制在弹出 ...
- arcgis union 0x80040218
我利用ArcGis中的union工具将两张图层叠加时,系统总是提示失败,这是什么原因?希望高手能够解决这个问题.图片是系统提示,表示看不懂哪里出错了? 你必须使用数据管理-要素-修复几何,源数据存在不 ...
- 第一个JSP程序
本文介绍如何写出第一个JSP程序 1.配置服务器 (1)在eclipse中选择Server视图,(ps:很多童鞋说找不到Server,那是因为eclipse的版本问题,请下载JEE版本的eclipse ...
- 谷歌的网页排序算法(PageRank Algorithm)
本文将介绍谷歌的网页排序算法(PageRank Algorithm),以及它如何从250亿份网页中捞到与你的搜索条件匹配的结果.它的匹配效果如此之好,以至于“谷歌”(google)今天已经成为一个被广 ...
- 深入理解Activity -动手写实例来感受Activity的启动模式
介绍 上篇提到了Activity的任务,任务栈,以及启动模式.对这些概念有了了解以后,自己写一下例子来感受一下,就当作复习和加深印象了.如果对概念不熟悉的可以参考:深入理解Activity-任务,回退 ...
- JAVA基础学习day19--IO流一、FileWrite与FileReader
一.IO简述 1.1.简述 IO:input/output IO流用来处理设备之间的数据传输 Java对数据的操作是通过流的方式 Java用于操作流的对象都在IO包中. 1.2.结构 字节流抽象类: ...
- UVa 104 - Arbitrage(Floyd动态规划)
题目来源:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&pa ...
- C# List中随机获取N个字符
static void Main(string[] args) { List<string> strList = new List<string>(); ; i <= ; ...