感谢 http://tool.lu/pyc/ 这个牛逼的网站能反编译pyc...他妈的Katana太他妈无耻了,竟然不让自定义加Node Tab Content....只能反编译他的东西了。。。

研究了下Katana的开发文档,做几个比较帅的事情。。。。

自定义Content

def registerMesser():
"""
Registers a new Messer node type using the NodeTypeBuilder utility class.
""" from Katana import Nodes3DAPI,NodegraphAPI
from Katana import FnAttribute def buildMesserOpChain(node, interface):
"""
Defines the callback function used to define the Ops chain for the
node type being registered. @type node: C{Nodes3DAPI.NodeTypeBuilder.Messer}
@type interface: C{Nodes3DAPI.NodeTypeBuilder.BuildChainInterface}
@param node: The node for which to define the Ops chain
@param interface: The interface providing the functions needed to set
up the Ops chain for the given node.
"""
# Get the current frame time
frameTime = interface.getGraphState().getTime() # Set the minimum number of input ports
interface.setMinRequiredInputs(1) argsGb = FnAttribute.GroupBuilder() # Parse the CEL parameter
celParam = node.getParameter('CEL')
if celParam:
argsGb.set('CEL', celParam.getValue(frameTime)) # Parse the displacement parameter
dispParam = node.getParameter('displacement')
if dispParam:
argsGb.set('displacement', dispParam.getValue(frameTime)) # Add the Messer Op to the Ops chain
interface.appendOp('Messer', argsGb.build()) # Create a NodeTypeBuilder to register the new type
nodeTypeBuilder = Nodes3DAPI.NodeTypeBuilder('Messer')
#NodegraphAPI.RegisterPythonNodeType('Messer', Messer)
NodegraphAPI.AddNodeFlavor('Messer', '3d')
NodegraphAPI.AddNodeFlavor('Messer', 'HoudiniFX')
# Add an input port
nodeTypeBuilder.setInputPortNames(('in',)) # Build the node's parameters
gb = FnAttribute.GroupBuilder()
gb.set('CEL', FnAttribute.StringAttribute(''))
gb.set('displacement', FnAttribute.FloatAttribute(0.0)) # Set the parameters template
nodeTypeBuilder.setParametersTemplateAttr(gb.build())
# Set parameter hints
nodeTypeBuilder.setHintsForParameter('CEL', {'widget':'cel'})
# Set the callback responsible to build the Ops chain
nodeTypeBuilder.setBuildOpChainFnc(buildMesserOpChain) # Build the new node type
nodeTypeBuilder.build() # Register the node
registerMesser()

自定义LayerTabMenu,记得放到环境变量里的UIPlugins文件夹

def registerMesser():
"""
Registers a new Messer node type using the NodeTypeBuilder utility class.
""" from Katana import Nodes3DAPI,NodegraphAPI
from Katana import FnAttribute def buildMesserOpChain(node, interface):
"""
Defines the callback function used to define the Ops chain for the
node type being registered. @type node: C{Nodes3DAPI.NodeTypeBuilder.Messer}
@type interface: C{Nodes3DAPI.NodeTypeBuilder.BuildChainInterface}
@param node: The node for which to define the Ops chain
@param interface: The interface providing the functions needed to set
up the Ops chain for the given node.
"""
# Get the current frame time
frameTime = interface.getGraphState().getTime() # Set the minimum number of input ports
interface.setMinRequiredInputs(1) argsGb = FnAttribute.GroupBuilder() # Parse the CEL parameter
celParam = node.getParameter('CEL')
if celParam:
argsGb.set('CEL', celParam.getValue(frameTime)) # Parse the displacement parameter
dispParam = node.getParameter('displacement')
if dispParam:
argsGb.set('displacement', dispParam.getValue(frameTime)) # Add the Messer Op to the Ops chain
interface.appendOp('Messer', argsGb.build()) # Create a NodeTypeBuilder to register the new type
nodeTypeBuilder = Nodes3DAPI.NodeTypeBuilder('Messer')
#NodegraphAPI.RegisterPythonNodeType('Messer', Messer)
NodegraphAPI.AddNodeFlavor('Messer', '3d')
NodegraphAPI.AddNodeFlavor('Messer', 'HoudiniFX')
# Add an input port
nodeTypeBuilder.setInputPortNames(('in',)) # Build the node's parameters
gb = FnAttribute.GroupBuilder()
gb.set('CEL', FnAttribute.StringAttribute(''))
gb.set('displacement', FnAttribute.FloatAttribute(0.0)) # Set the parameters template
nodeTypeBuilder.setParametersTemplateAttr(gb.build())
# Set parameter hints
nodeTypeBuilder.setHintsForParameter('CEL', {'widget':'cel'})
# Set the callback responsible to build the Ops chain
nodeTypeBuilder.setBuildOpChainFnc(buildMesserOpChain) # Build the new node type
nodeTypeBuilder.build() # Register the node
registerMesser()

Create Your Tab and LayerTabMenu In Katana的更多相关文章

  1. [Ext JS 4] 布局之实战一 - 中间区块不会自动伸展 (tab)

    前言 [Ext JS 4] 布局之实战一 - 中间区块不会自动伸展 (tab) 在上一篇中,中间的tab 区块无法自动伸展的原因一句话说就是: 使用contentEL的方式,相关HTML元素不会参与组 ...

  2. [20190130]删除tab$记录的恢复.txt

    [20190130]删除tab$记录的恢复.txt --//网上提到许多删除tab$的案例,主要原因在于没有从官方正规渠道下载oracle版本,还有一些来自工具里面带有一些脚本删除tab$记录. -- ...

  3. [20190227]简单探究tab$的bojb#字段.txt

    [20190227]简单探究tab$的bojb#字段.txt --//上午做了删除tab$表,其对应索引i_tab1的恢复,我一直以为这个索引会很大,没有想到在我的测试环境仅仅139个键值.--//查 ...

  4. ExtJS4中设置tabpanel的tab高度问题

    最近碰到个问题,在ExtJS中应该如何设置tabpanel的tab的高度?因为默认情况下,tab的高度太矮了,以至于tab的标题底部字都被截掉.设置了个tabpanel.minHeight = ‘50 ...

  5. Android TabHost设置setCurrentTab(index),当index!=0时,默认加载第一个tab问题解决方法。

    最近在用TabHost,默认希望显示第2个tab,发现总是加载第三个tab的同时加载第一个,解决方法如下: 1.首先查看addTab(TabSpec tabSpec)源代码: /** * Add a ...

  6. ExtJS 4.2 组件介绍

    目录 1. 介绍 1.1 说明 1.2 组件分类 1.3 组件名称 1.4 组件结构 2. 组件的创建方式 2.1 Ext.create()创建 2.2 xtype创建 1. 介绍 1.1 说明 Ex ...

  7. ExtJS 4.2 业务开发(一)主页搭建

    本篇开始搭建一个ExtJS 4.2单页面应用, 这里先介绍主页的搭建,内容包括:主页结构说明.扩展功能等方面. 目录 1. 主页结构说明 2. 扩展功能 3. 在线演示 1. 主页结构说明 1.1 主 ...

  8. Mysql基础代码(不断完善中)

    Mysql基础代码,不断完善中~ /* 启动MySQL */ net start mysql /* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码 /* 跳过权限 ...

  9. 【转】一千行MySQL学习笔记

    /* 启动MySQL */ net start mysql   /* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码   /* 跳过权限验证登录MySQL */ ...

随机推荐

  1. Hadoop.2.x_WebUV示例

    一.网站基本指标(即针对于网站用户行为而产生的日志中进行统计分析) 1. PV:网页浏览量(Page View页面浏览次数,只要进入该网页就产生一条记录,不限IP,统计点每天(较多)/每周/每月/.. ...

  2. Hadoop.2.x_高级应用_二次排序及MapReduce端join

    一.对于二次排序案例部分理解 1. 分析需求(首先对第一个字段排序,然后在对第二个字段排序) 杂乱的原始数据 排序完成的数据 a,1 a,1 b,1 a,2 a,2 [排序] a,100 b,6 == ...

  3. 【HDU 4747 Mex】线段数

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4747 题意:有一组序列a[i](1<=i<=N), 让你求所有的mex(l,r), mex ...

  4. Oracle常用命令(持续更新)

    --1.解锁用户 alter user 用户名 account unlock; --2.开启最小补充日志记录(执行的DML操作会被记录下来)  alter database add supplemen ...

  5. tomcat启动后,在普通java类中获取spring管理的bean和ServletContext,(经过验证,可以取到)

    //从spring容易中获取bean public static Object getBean(String beanName){ ApplicationContext context = Conte ...

  6. Mac 系统下cocos2dx 环境变量设置

    Mac 系统环境变量设置   vim ~/.bash_profile    export PATH=$PATH:/Users/wangchengcheng/Downloads/LearningSoft ...

  7. c#前3章总结

    01.net和c#的区别 大概在2000年,微软推出了一种革命性的产品--.NET(战略) 目标:任何人,在任何地方,使用任何终端设备,都可以访问微软提供的服务. .net Framework:要想让 ...

  8. Construct a tree from Inorder and Level order traversals

    Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is a ...

  9. Java的析构函数System的finalize()

    一个对象是由产生 到使用 到销毁的过程 即C++中 构造函数-> body->析构函数 在Java之中为了回收不需要的空间可以使用System类的finalize() class A{ p ...

  10. PHP的排序函数的总结

    Sort     破坏索引 升序    值排序 Rsort    破坏索引 降序    值排序 Asort    保持索引 升序     值排序 Arsort   保持索引 降序     值排序 Ks ...