Skip to content

Instantly share code, notes, and snippets.

View rondreas's full-sized avatar

Andreas Rånman rondreas

View GitHub Profile
@BigRoy
BigRoy / usdviewport_qt.py
Last active October 26, 2024 16:32
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
@chris-lesage
chris-lesage / soft_selection_weights.py
Last active November 15, 2024 11:43
Get a list of soft selection weights in Autodesk Maya
import maya.cmds as cmds
import maya.OpenMaya as omo
# (Open Maya Old)
def soft_selection_weights():
''' create and return a list of the soft selection weights '''
#TODO: Would be nice to rewrite this using the new API. Low priority.
#TODO: Debug on multiple selections
# temporary hack. Turn off symmetry when reading MRichSelection until I learn to use symmetry.
@Meatplowz
Meatplowz / FBX_Scene.py
Last active August 13, 2024 17:08
This is a wrapper FBX class useful in accessing and modifying the FBX Scene
"""
MIT License
Copyright (c) [year] [fullname]
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
@rondreas
rondreas / checksum.py
Last active September 24, 2019 15:45
#!/usr/bin/python3
import hashlib, sys
"""
Command line tool to get checksums in python.
Supply filepath for file to process, and which hash
method to use.
"""
@mattcox
mattcox / pmodel_selectOdd.cpp
Last active August 26, 2021 14:27
Example of a simple selection operation for the Modo procedural modelling system that selects every other polygon. It demonstrates how to use thread slots, to allow selection to be evaluated from multiple threads
#include <lxsdk/lx_mesh.hpp>
#include <lxsdk/lx_pmodel.hpp>
#include <lxsdk/lx_seltypes.hpp>
#include <lxsdk/lx_thread.hpp>
#include <lxsdk/lxu_attributes.hpp>
#define SERVER_NAME "pmodel.selectEveryOther"
/*
* The Selection Operation is evaluated in parallel from multiple threads. As
#!/usr/bin/env python
# To install this plugin, simply copy this file (selectAxisUVs.py) into folder called "lxserv" in your modo scripts folder (and restart modo, if it's open).
# If you are unsure where your modo scripts folder is, you can open modo, then select System > Open User Scripts Folder.
# If there is no folder called "lxserv" in your MODO Scripts folder, simply create one and then put this file in there.
# Once MODO has been restarted, you can run the command via ffr.selectaxisuv
#
# Any issues, please drop me a line at [email protected].
#
# James O'Hare
@mattcox
mattcox / shapeDraw.py
Last active April 16, 2020 08:08
Python example demonstrating how to modify GL drawing of an item.
#python
'''
Shape Draw python example. This python plugins demonstrates how to create
a Package that can be added to existing items, that controls how they draw
in the GL viewport. We will simply draw a circle. A radius channel and an
sides channel will control how the circle is drawn.
To use, add the python script to an lxserv folder in your scripts directory.
Select an locator item and enter: item.addPackage shape.draw. To remove the
@mattcox
mattcox / SurfaceForce.py
Last active December 16, 2021 14:48
This example plugin for modo 701, shows how to create a surface force in Python. The force will read a mesh, get the closest position on that mesh and find the normal at that position. A force will be created along the normal vector of the surface. The result is a force that pushes particles and dynamic objects away from the surface.
#python
'''
Surface Force
This example plugin for modo 701, shows how to create a surface force in
Python. The force will read a mesh, get the closest position on that mesh
and find the normal at that position. A force will be created along the
normal vector of the surface. The result is a force that pushes particles