utils
blender.py
- FCurvesFromObject(obj)
- cleanCollection(col: bpy.types.Collection, refObject: bpy.types.Object = None) -> (col: bpy.types.Collection, refObject: bpy.types.Object = None)
Cleans a collection of old objects (to be reanimated)
- distanceFromVectors(point1: mathutils.Vector, point2: mathutils.Vector) -> (point1: mathutils.Vector, point2: mathutils.Vector)
Calculate distance between two points.
- framesToSec(frames: float) -> (frames: float)
- getExactFps()
- objectsOverlap(obj1: bpy.types.Object, obj2: bpy.types.Object) -> (obj1: bpy.types.Object, obj2: bpy.types.Object)
returns True if the object’s bounding boxes are overlapping
- secToFrames(sec: float) -> (sec: float)
- setKeyframeHandleType(obj: bpy.types.Object, handleType, data_path=None)
- shapeKeyFCurvesFromObject(obj)
- shapeKeysFromObject(obj: bpy.types.Object) -> (obj: bpy.types.Object)
gets shape keys from object
- Parameters
object (bpy.types.Object) – the blender object
- Return tuple
returns a tuple, first element being a list of the shape keys and second element being the reference key
- timeFromVectors(point1: mathutils.Vector, point2: mathutils.Vector, velocity: float) -> (point1: mathutils.Vector, point2: mathutils.Vector, velocity: float)
- velocityFromVectors(point1: mathutils.Vector, point2: mathutils.Vector, frames: float) -> (point1: mathutils.Vector, point2: mathutils.Vector, frames: float)
Calculates velocity from 2 vectors given a time
- worldBoundingBox(obj: bpy.types.Object)
returns the corners of the bounding box of an object in world coordinates
gmInstrumentMap.py
loggerSetup.py
Module contents
- gmProgramToName(pcNum: int) -> (pcNum: int)
Takes a General MIDI program change number from 0-127 and returns the GM instrument name.
- Parameters
pcNum (int) – program change number
- Return str
GM instrument name
- mapRangeArcSin(value, inMin, inMax, outMin, outMax)
- mapRangeExp(value, inMin, inMax, outMin, outMax)
- mapRangeLinear(value, inMin, inMax, outMin, outMax)
- mapRangeLog(value, inMin, inMax, outMin, outMax)
- mapRangePara(value, inMin, inMax, outMin, outMax)
- mapRangeRoot(value, inMin, inMax, outMin, outMax)
- mapRangeSin(value, inMin, inMax, outMin, outMax)
- nameToNote(nStr: str) -> (nStr: str)
Takes a name and returns the MIDI note number Example: nameToNote(“C3”) returns 60
- Parameters
nStr (str) – the note name
- Return int
the MIDI note number
- noteToName(nVal: int) -> (nVal: int)
Takes a MIDI note number and returns the name Example: noteToName(60) returns “C3”
- Parameters
nVal (int) – the MIDI note number
- Return str
the note name
- removeDuplicates(vals: list) -> (vals: list)
Removes duplicate items from a list. Useful for getting all used note numbers in a MIDI File.
- Parameters
vals (list) – input list
- Return list
duplicates removed
- rotateAroundCircle(radius, angle)
Takes a radius (x) and an angle (y) and returns it’s X & Y.