Create_Houdini_tools
:version Houdini 15.5.673
Pythonで自分用にカスタマイズしたtoolを使用して
作業効率をグンっとあげたい1~2年のJunior Artist(僕みたいな人)や
ベテランPythonistaに色々と聞く前にHoudiniを通してとりあえずPython勉強したい人向けです。
:Shareしているscriptはtestで作成していたモノなので自分都合でガンガン変えちゃってください。
Empty GeometryNodeを作成する
# === UI function ===#
getp = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor);
pos = getp.selectPosition();
# === obj class===#
obj = hou.node("/obj");
# Create OBJ node
geo = obj.createNode("geo","FXwork",0);
# SetColor
geoCol = hou.Color((0.0,0.533,0.0));
geo.setColor(geoCol);
# Set position
geo.setPosition(pos);
:Render tabは考慮されません(削除してます)
.abcを.bgeo_Cacheにするasset
# ===== UI Function =====#
getp = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor);
pos = getp.selectPosition();
# ===== OBJ Class =====#
obj = hou.node("/obj");
geo = obj.createNode("geo","Cache_Publish",0);
# Node Color
geoCol = hou.Color((0.0,0,6,0.6));
geo.setColor(geoCol);
# Set Position
geo.setPosition(pos);
# ===== Sop Class =====#
# Get Sop Path
soppath =geo.path();
print soppath;
# Get Sop node
sop = hou.node(soppath);
# Create Node Object Merge
imprt= sop.createNode("object_merge","Import_Geo");
# ==== Edit parameters===#
imprt_parm = imprt.parm("xformtype");
imprt_parm.set(1);
# Create Node unpack
unpack = imprt.createOutputNode("unpack");
# === Edit parameters ===#
unpackparm = unpack.parm("transfer_attributes");
unpackparm.set("*");
# Create Node filecache
filecache = unpack.createOutputNode("filecache","customName");
# === Edit Parameter ===#
cache_parm01 = filecache.parm("loadfromdisk");
cache_parm01.set = (1);
# Edit path
cache_parm02 = filecache.parm("file");
cache_parm02.set("$HIP/geo/$OS/$OS.$F.bgeo.sc");
# Create Node Null
null = filecache.createOutputNode("null","OUT");
SHOPnetworkを作成する
# Set UI function
setp = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor);
uiP = setp.selectPosition();
# /obj directory ffunction#
obj = hou.node("/obj");
work = obj.createNode("shopnet","SHOP",0);
work.setPosition(uiP);
# parent path is here
objpath =work.path();
# Def Color
defcol = hou.Color((1.0,0.8,0));
work.setColor(defcol);
Shader_Builderを作成する
# error function
# error picker dialog
select = hou.selectedNodes()
if len(select)!=0:
hou.ui.displayMessage('-userGuide-\n ============\
\nSimple Material Builder\n ============',title= 'dialogMessage');
node = select[0].path()
print 'nodepath=='+ node
else:
hou.ui.displayMessage('-User Support-\nSelect ShaderNetwork\n\
============\nSample...\n Shopnet = SHOP\n SHOP = ShaderNetwork\n\n\
============',title= 'dialogMessage');
# Function Select is End
userpath = node;
# Set UI function
shop = hou.node(userpath);
builder = shop.createNode("vopmaterial","ShaderBuilder");
builder.moveToGoodPosition()
# Finish Function
hou.ui.displayMessage("Sucess!!!");
:Popup_Windowを使用してます。
ROPnetworkを作成する
# Set UI function
setp = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor);
uiP = setp.selectPosition();
# /obj directory ffunction#
obj = hou.node("/obj");
work = obj.createNode("ropnet","ROP",0);
work.setPosition(uiP);
# parent path is here
objpath =work.path();
# Def Color
defcol = hou.Color((1.0,0,0.5));
work.setColor(defcol);
MantraNodeを作成する
# error function
# error picker dialog
select = hou.selectedNodes()
if len(select)!=0:
hou.ui.displayMessage('-userGuide-\n ============\
\nSimple Mantra_node\n ============',title= 'dialogMessage');
path= select[0].path()
print path
else:
hou.ui.displayMessage('-User Support-\nSelect RenderGeometry\n\
============\nSample...\n Add MantraNode\n Create SelectGeometry\n\n\
============',title= 'dialogMessage');
# Function Select is End
if len(select)!=0:
text = hou.ui.readInput(message = "-userGuide-\n==============\nMantraNode_Name\
\n==============\n-typeHere-\n",);
else:
none;
typename = text[1];
userPath =(path);
rop = hou.node(userPath);
mantra = rop.createNode("ifd");
mantra.setName(typename,0)
mantra.moveToGoodPosition();
:Popup_Windowを使用してます。
Python書籍やHelpと照らし合わせながら
自分なりに使いやすいToolをガンガン作って楽しましょう