Skip to content

Instantly share code, notes, and snippets.

@BigRoy
BigRoy / usd_list_layer_edits_editor.py
Last active February 27, 2024 23:16
Quick and dirty "List USD Layer Edits" to allow removal of Sdf.PrimSpec, Sdf.PropertySpec, Sdf.AttributeSpec, Sdf.RelationshipSpec through a Python Qt interface
from PySide2 import QtCore, QtWidgets, QtGui
from pxr import Usd, Tf, Sdf
# See: https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/usd/sdf/fileIO_Common.cpp#L879-L892
SPECIFIER_LABEL = {
Sdf.SpecifierDef: "def",
Sdf.SpecifierOver: "over",
Sdf.SpecifierClass: "abstract"
}
@BigRoy
BigRoy / usdviewport_qt.py
Last active July 17, 2024 20:22
Example of how to embed a simple USD viewport in Qt application
"""
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
//
// Author: Jonathan Blow
// Version: 1
// Date: 31 August, 2018
//
// This code is released under the MIT license, which you can find at
//
// https://opensource.org/licenses/MIT
//
//
@JohnOnSoftware
JohnOnSoftware / XGenForArnold.cpp
Last active February 22, 2024 09:45
Core code to support XGen Interactive Grooming in Arnold
MFnDagNode fnDagNode(m_dagPath);
// Apply the render overrides
static const MString sApplyRenderOverrideCmd = "xgmSplineApplyRenderOverride ";
MGlobal::executeCommand(sApplyRenderOverrideCmd + fnDagNode.partialPathName());
// Stream out the spline data
std::string data;
MPlug outPlug = fnDagNode.findPlug("outRenderData");
MObject outObj = outPlug.asMObject();
@alecthomas
alecthomas / Notifications.hh
Created November 19, 2014 22:53
EntityX system for replacing all builtin events
#pragma once
#include <vector>
#include <entityx/Entity.h>
#include <entityx/System.h>
namespace entityx {
struct Notification : public Component<Notification> {
EntityManager::ComponentMask components_added, components_removed;