the correct way add .obj to shelf

   1675   4   0
User Avatar
Member
91 posts
Joined: Oct. 2015
Offline
the correct way add .obj to shelf

there only simple 3d geometry

what i want set set a shelf up with few models

lot like Modo Qbics

what drag and drop and Ctrl + click on model in shelf (so center)

been playing a round but i get errors . can not seem get it right
User Avatar
Member
636 posts
Joined: June 2006
Offline
there is no correct way to do it :-)

there are a lot of ways :-)

just made a simple video:
https://vimeo.com/152146251 [vimeo.com]

whats also possible is to make a small python script that checks a folder where you have got your preset meshes. for the interface you could use a selectFromList Function to show your meshes. so you will have just one icon on the shelf for all your presets. :-)

Python Functions:
http://www.sidefx.com/docs/houdini15.0/hom/hou/ui [sidefx.com]
User Avatar
Member
636 posts
Joined: June 2006
Offline
just had some time to make a example:

Make a New Tool in the Shelf and add the Code.
Script Language must be Python.
Use bgeo Files for faster loading :-)


import hou
import os

# Set your path to your files
path = ‘C:\\PATH\\TO\\YOUR\\FILES’
files = os.listdir(path)

selected = hou.ui.selectFromList(files,exclusive=True, title='myGeo')
if len(selected) != 0:
obj = hou.node('/obj')
node = obj.createNode('geo', ‘myPreset’)
p = hou.parm('/obj/' + node.name() + ‘/file1/file’)
p.set(path + “/” + files[selected])

Attachments:
houdini_2016-01-18_14-32-04.png (218.4 KB)

User Avatar
Member
91 posts
Joined: Oct. 2015
Offline
Thank you very much very kind of you to do video for me.

very much appreciated “mandrake0”

very helpful
User Avatar
Member
636 posts
Joined: June 2006
Offline
no problem videos area mostly easyer for new users then a document.
  • Quick Links