2009年12月6日 如何将自定义gizmo插件定位到工具栏上

 

 
For this you need to first create a new folder call '.nuke'. I needs to be made in either...
OSX - /Users/your user name
Windows XP - \Documents and Settings\your user name

Next write a text file with the following information in it.


# Custom Nuke Menu on Toolbar
import nuke
import os.path

# Get the top-level toolbar
toolbar = nuke.menu("Nodes")

# FX Share Menu definitions
m = toolbar.addMenu("TestMenu", "testMenu.png")
m.addCommand("depthSlice", "nuke.createNode(\"depthSlice\")",icon="depthSlice.png")
m.addCommand("Reorder", "nuke.createNode(\"reorder\")",icon="reorder.png")
m.addCommand("iDilateErode", "nuke.createNode(\"iDilateErode\")",icon="iDilateErode.png")


The information above in dark blue is what you will need to replace with your own custom information, everything else need to remain the same.
The dark blue lines of code follow a pattern,
m.addCommand("nameOfGizmo"
This part is the name of the Gizmo which you have made and save into the root of .nuke, ie nameOfGizmo.gizmo

, "nuke.createNode(\"depthSlice\")"
This part created the name of the tool you'll see in the Toolbar and put's it into the menu defined above, in our case 'testMenu'.

,icon="depthSlice.png")
This final part adds the icon you will see in the menu of the Toolbar. It needs to be save at a .PNG file, 24 pixels by 24 pixels. Also note that there is also a .PNG file in the line where the new menu on the Toolbar is created. In our example above it's
m = toolbar.addMenu("TestMenu", "testMenu.png").
The best order to work in overall is to first create the gizmo and save it in the root of '.nuke'
Secondly create the 32x32 pixel icon you want to use and save that in the root of '.nuke' as a PNG file.
Finally create/edit the file
above saving it as menu.py again into the root of '.nuke'
You should end of up was a number of files in '.nuke' such as...
menu.py
nukeMagicTool1.gizmp
nukeMagicTool1.png
nukeSuperTool1.gizmo
nukeSuperTool1.png


转自Sphere VFX

转载于:https://www.cnblogs.com/aboutVFX/archive/2009/12/06/1617876.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值