Skip to content

Instantly share code, notes, and snippets.

View gregoiredehame's full-sized avatar

gregoire.dehame gregoiredehame

View GitHub Profile
@gregoiredehame
gregoiredehame / QTreeWidget.py
Last active February 7, 2025 19:22
Only QTreeWidget you'll need
from .. import qt
class Node():
def __init__(self, name=""):
self.name = name
self.length = len(name)
class TreeNode(qt.QTreeWidgetItem):
def __init__(self, parent:qt.QTreeWidgetItem=None, data:Node=None) -> None:
@gregoiredehame
gregoiredehame / spaceMatrix.cpp
Last active October 25, 2024 18:40
maya .cpp plugin for matrix space switching
#include <maya/MFnPlugin.h>
#include <maya/MPxNode.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnCompoundAttribute.h>
#include <maya/MTransformationMatrix.h>
#include <maya/MQuaternion.h>
#include <maya/MVector.h>
#include <maya/MArrayDataHandle.h>
#include <maya/MMatrix.h>
@gregoiredehame
gregoiredehame / spaceMatrix.py
Last active October 25, 2024 18:39
maya .py node for matrix space switching
import maya.api.OpenMaya as om2
def maya_useNewAPI():
pass
class spaceMatrix(om2.MPxNode):
id_ = om2.MTypeId(0x00124dee)
def __init__(self) -> None:
#include <maya/MPxNode.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnTypedAttribute.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MFnNurbsCurve.h>
#include <maya/MFnNurbsCurveData.h>
#include <maya/MTransformationMatrix.h>
#include <maya/MArrayDataHandle.h>
#include <maya/MPointArray.h>
#include <maya/MGlobal.h>
import maya.api.OpenMaya as om2
def maya_useNewAPI():
pass
class curveConstraint(om2.MPxNode):
id_ = om2.MTypeId(0x00124ddf)
@gregoiredehame
gregoiredehame / parentJointMatrix.cpp
Last active October 15, 2024 03:21
c++ plugin for joint parent matrix, that maintain 0.0.0 rotations angles on joints.
#include <maya/MPxNode.h>
#include <maya/MFnMatrixAttribute.h>
#include <maya/MFnUnitAttribute.h>
#include <maya/MFnNumericAttribute.h>
#include <maya/MFnEnumAttribute.h>
#include <maya/MTransformationMatrix.h>
#include <maya/MGlobal.h>
#include <maya/MQuaternion.h>
#include <maya/MMatrix.h>
#include <maya/MFnPlugin.h>
@gregoiredehame
gregoiredehame / parentJointMatrix.py
Last active October 15, 2024 01:38
maya api 2.0 parent matrix custom node, that maintain 0.0.0 rotations angles on joints.
import maya.api.OpenMaya as om2
def maya_useNewAPI():
pass
class parentJointMatrix(om2.MPxNode):
id_ = om2.MTypeId(0x00124dfe)
@gregoiredehame
gregoiredehame / packages.py
Last active September 27, 2024 04:18
maya python mayapy package verification/installation
from __future__ import annotations
import sys
import os
import requests
import importlib
import subprocess
import pkg_resources
import maya.cmds as cmds
from __future__ import annotations
import maya.cmds as cmds
import maya.api.OpenMaya as om2
import math
def get_weights() -> list:
"""
function that will return a list of float value based on current soft selection.
"""
@gregoiredehame
gregoiredehame / push_matrix.py
Last active February 20, 2024 20:32
native maya push matrix collider
import maya.cmds as cmds
import maya.mel as mel
import maya.api.OpenMaya as om2
if __name__ == '__main__':
from kata import core as kcore
from kata import rig as krig
else:
from .. import core as kcore
from .. import rig as krig