Skip to content

Instantly share code, notes, and snippets.

View SatishGodaPearl's full-sized avatar

Satish Goda SatishGodaPearl

View GitHub Profile
@SatishGodaPearl
SatishGodaPearl / ng_proto.py
Last active January 23, 2020 01:11
Node Graph Architecture
import logging
log = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter('%(levelname)s: %(message)s')
handler.setFormatter(formatter)
log.addHandler(handler)
log.setLevel(logging.INFO)
@SatishGodaPearl
SatishGodaPearl / blender28_run_qt_ui.py
Created January 5, 2020 20:53 — forked from BigRoy/blender28_run_qt_ui.py
Simple example of running a Qt interface in Blender 2.8 without blocking Blender.
import bpy
from PyQt5 import QtWidgets
class QtModalOperator(bpy.types.Operator):
"""A base class for Operators that run a Qt interface."""
def modal(self, context, event):
if self._app:
@SatishGodaPearl
SatishGodaPearl / obj_in_frust.py
Created October 11, 2019 00:03 — forked from Kif11/obj_in_frust.py
Maya script to find if object located within camera frustum
import maya.cmds as cmds
import maya.OpenMaya as OpenMaya
import math
# Find if object located within camera frustum
# Usage:
# from obj_in_frust import in_frustum
# in_frustum('camera1', 'pCube1')
class Plane(object):
@SatishGodaPearl
SatishGodaPearl / References.md
Last active August 13, 2019 00:15
Python Exception Handling
@SatishGodaPearl
SatishGodaPearl / camel_case_to_snake_case.py
Created June 26, 2019 21:28 — forked from jaytaylor/camel_case_to_snake_case.py
Convert camel-case to snake-case in python.
#!/usr/bin/env python
"""
Convert camel-case to snake-case in python.
e.g.: CamelCase -> snake_case
Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064
"""
@SatishGodaPearl
SatishGodaPearl / export_nodes_and_store_node_data.py
Created March 19, 2019 17:30 — forked from fredrikaverpil/export_nodes_and_store_node_data.py
Export and re-assign shaders, nodes and node data #maya
import maya.cmds as cmds
def getAttributes(object):
attributes = cmds.listAttr(object)
for attribute in attributes:
try:
print attribute + ' = ' + str(cmds.getAttr(object + '.' + attribute))
except:
pass
@SatishGodaPearl
SatishGodaPearl / api.py
Created February 1, 2019 08:05
Maya Playblast
import pymel.core as pm
import sgtk
engine = sgtk.platform.current_engine()
pearlmaya = sgtk.platform.framework.load_framework(engine, engine.get_env(), 'tk-framework-pearl-maya_v0.x.x')
mayasession = pearlmaya.import_module('mayasession')
ctxWork = mayasession.MayaAssetWork()
@SatishGodaPearl
SatishGodaPearl / rendersetup.py
Created January 22, 2019 21:10
Lunaria Variant Workflow Prototypes
import maya.app.renderSetup.model.override as override
import maya.app.renderSetup.model.selector as selector
import maya.app.renderSetup.model.collection as collection
import maya.app.renderSetup.model.renderLayer as renderLayer
import maya.app.renderSetup.model.renderSetup as renderSetup
import maya.cmds as cmds
rs = renderSetup.instance()
defaultRenderLayer = rs.getDefaultRenderLayer()