FX_tool for Hython Basic01

Create_Houdini_tools
:version Houdini 15.5.673

파이썬에서 자신을 위해 맞춤화 된 도구를 사용하여
작업 효율을 굉장히 하고 싶은 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을 건간 만들어 즐겨보세요

좋은 웹페이지 즐겨찾기