感谢 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. SQL servcer 时间日期函数、数据类型转换

    1.时间日期函数 2.数据类型转换 3.习题 建立两个表,一个部门表,一个人员表.部门:部门的编号,部门的名称,部门的职责.人员:人员的编号,姓名,年龄,性别,cid所属部门

  2. 流式布局&固定宽度&响应式&rem

    我们现在在切页面布局的使用常用的单位是px,这是一个绝对单位,web app的屏幕适配有很多中做法,例如:流式布局.限死宽度,还有就是通过响应式来做,但是这些方案都不是最佳的解决方法. 1.流式布局: ...

  3. js的关联数组

    我自己感觉js是不支持关联数组的,只有索引数组.想要实现js关联数组的效果,就使用js的对象,使用键值对.如果对数组动态处理用push函数,取值用pop函数.此外,对数组操作有几个比较好的函数,joi ...

  4. c# select标签绑定枚举,并以Description做Text显示

    今天在做项目时遇到一个问题: 开发中有些字段是枚举类型如 Dept 企业表中可能有个字段 Property 性质 0:事业单位,1:私企,2:外企,但有时我们不会单独为性质这个字段定义一张表, 而是在 ...

  5. hdu1201-18岁生日

    Gardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从 ...

  6. C遇到的问题

    1. stdout-------printf输出到stdout,并在终端打印 stderr--------perror错误输出到stderr,并在终端打印 2. usleep(1)//代表一微妙 sl ...

  7. C# Image 、 byte[] 、Bitmap之间的转化

    一.Byte[] 转 System.Drawing.Bitmap public static Bitmap CreateBitmap(byte[] originalImageData, int ori ...

  8. mysql前缀索引(字符串截取部分作为索引), 以及索引选择指引

  9. bash 常用操作

    删除不为空的文件夹 rm -rf dir_name

  10. symmetric multiprocessor

    https://en.wikipedia.org/wiki/Symmetric_multiprocessor_system A symmetric multiprocessor system (SMP ...