Skip to content

Instantly share code, notes, and snippets.

Avatar

Roy Nieterau BigRoy

View GitHub Profile
@BigRoy
BigRoy / print_alembic_shape_attributes.py
Created Sep 22, 2020
Debug print out Alembic PolyMesh attributes
View print_alembic_shape_attributes.py
import alembic
def _print_properties(property, depth=1):
# Property name
print ("\t" * depth) + property.getName()
# Metadata
metadata = property.getMetaData()
if metadata.size():
@BigRoy
BigRoy / maya_list_all_children_with_instances.py
Last active Mar 27, 2020
Autodesk Maya Python list or query all children including each instance
View maya_list_all_children_with_instances.py
"""When using maya.cmds.listRelatives with allDescendents=True it will only return the first instanced child.
Below are some example functions that correctly return all instanced children where they are "somewhat" optimized to rapidly return a result as opposed to slow recursive queries.
"""
import maya.api.OpenMaya as om
from maya import cmds
import time
import re
@BigRoy
BigRoy / maya_snap_objects_to_target_vertex.py
Created Mar 20, 2020
Snap multiple objects by vertex index to target vertex.
View maya_snap_objects_to_target_vertex.py
"""Snap multiple objects by vertex index to target vertex.
1. Select all objects you want to snap
2. Add the target vertex to your selection.
3. Run script
Make sure each object has the same topological order because
this just simply snaps the same vertex number of each object
to the selected target vertex.
@BigRoy
BigRoy / hou18_solaris_python_addremove_usd_outputprocessors.py
Created Jan 29, 2020
Houdini 18 Solaris Add and Remove USD Rop node Output Processors with Python
View hou18_solaris_python_addremove_usd_outputprocessors.py
import contextlib
import hou
def add_output_processor(ropnode, processor):
"""Add USD Output Processor to USD Rop node.
Args:
ropnode (hou.RopNode): The USD Rop node.
processor (str): The output processor name. This is the basename of
the python file that contains the Houdini USD Output Processor.
@BigRoy
BigRoy / avalon_cgwire_qtazu_link.py
Last active Dec 15, 2019
Example API for linking CG-Wire with Avalon with Qtazu
View avalon_cgwire_qtazu_link.py
@BigRoy
BigRoy / usdviewport_qt.py
Last active Aug 27, 2020
Example of how to embed a simple USD viewport in Qt application
View usdviewport_qt.py
"""
MIT License
Copyright (c) 2019 Roy Nieterau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@BigRoy
BigRoy / blender2019_conference.md
Last active Oct 25, 2019
Breakdown of Blender 2019 Live stream conference moments https://www.youtube.com/watch?v=ioAZgnSh7X4
View blender2019_conference.md

Blender Conference 2019 - LIVE stream breakdown

Stream: https://www.youtube.com/watch?v=ioAZgnSh7X4

Below is a rough breakdown of moments/times of talks in the video. Feel free to comment with more thorough notes you might have taken during the talk or video. Plus, comments that include other timings of talks that are still missing are more than welcome!

Please be aware that most of these talks are also uploaded as separate videos to the Blender youtube channel almost instantly after the talk finishes. I'll link the title of each to the separate video. Here is the full playlist per video

Ian Hubert - World Building in Blender

@BigRoy
BigRoy / avalon_maya_host_ls_optimizations.py
Created Sep 26, 2019
Avalon Maya host ls() query optimization tests
View avalon_maya_host_ls_optimizations.py
from maya import cmds
import maya.api.OpenMaya as om
from avalon.pipeline import AVALON_CONTAINER_ID
import avalon.maya.pipeline
# Current implementation
ls = avalon.maya.pipeline._ls
@BigRoy
BigRoy / maya_renderlayer_fix_unable_to_duplicate.py
Created Aug 28, 2019
Fix Maya legacy renderlayer being unable to duplicate (it doesn't show up correctly, but it does create a new renderLayer node visible when Show DAG nodes only is disabled)
View maya_renderlayer_fix_unable_to_duplicate.py
# Fix Maya bug where you cannot duplicate a renderlayer correctly bug
# This is with Legacy Renderlayers, not Render Setup.
# Bug has been found in both Maya 2018 + 2019
import maya.cmds as mc
# Recreate all renderlayer overrides (.adjustments)
for layer in mc.ls(type="renderLayer"):
attr = layer + ".adjustments"
@BigRoy
BigRoy / maya_remove_CgAbBlastPanelOptChangeCallback.py
Created Aug 8, 2019
Little snippet to remove "CgAbBlastPanelOptChangeCallback" error from Maya scene - // Error: line 1: Cannot find procedure "CgAbBlastPanelOptChangeCallback". //
View maya_remove_CgAbBlastPanelOptChangeCallback.py
"""
This will iterate all modelPanels and remove the "CgAbBlastPanelOptChangeCallback"
As such, after running this the following error should be fixed:
// Error: line 1: Cannot find procedure "CgAbBlastPanelOptChangeCallback". //
"""
from maya import cmds
for model_panel in cmds.getPanel(typ="modelPanel"):
You can’t perform that action at this time.