Skip to content

Instantly share code, notes, and snippets.

View deepakxyz's full-sized avatar
🎯
Focusing

Deepak Rajan deepakxyz

🎯
Focusing
View GitHub Profile
@deepakxyz
deepakxyz / gist:cab38fcbc73e534a81db42b991b257ac
Last active November 11, 2022 07:00
Walk through nested dic and return with parent
dic = {
"root_grp": {
"a":{
"a1":{
"aa1":{},
"aa2":{}
},
"a2":{}
} ,
@deepakxyz
deepakxyz / hou_GetCurrentFilePath.py
Last active January 11, 2022 15:30
Copy the current file path to the clipboard
import hou
# get current path
current_file_path = hou.hipFile.name()
# copy to clipboard using PySide2
from PySide2 import QtGui
app = QtGui.QGuiApplication.clipboard()
app.setText(current_file_path)
node = hou.pwd()
geo = node.geometry()
r = node.evalParm('colorr')
g = node.evalParm('colorg')
b = node.evalParm('colorb')
print(r,g,b)
node.setColor(hou.Color(r,g,b))
@deepakxyz
deepakxyz / Create Wrangle.py
Last active January 11, 2022 15:47
Create attribute wrangle under the selected node
node = hou.selectedNodes()[0]
attributeWrangle = node.parent().createNode('attribwrangle')
attributeWrangle.setInput(0,node)
attributeWrangle.setPosition(node.position() + hou.Vector2(0,-1))
#attributeWrangle.setColor(hou.Color((0.4,0.6,1.0)))
attributeWrangle.setDisplayFlag(True)
attributeWrangle.setRenderFlag(True)