API
The API is exposed as a Python module, pianoray
. This page contains
documentation for each object. See TODO for information on how to use the
API.
Property Group
- class pianoray.PropertyGroup
Group of properties. Define a subclass to create your PropertyGroup. Define properties by creating annotations with
:
. Don’t override any methods, as instancing a PropertyGroup subclass requires the methods.class MyProps(PropertyGroup): temperature: FloatProp( name="Temperature", desc="Temperature to cook the food at.", default=-10, ) food: StringProp( name="Food", desc="The food to cook.", default="Java", )
You can set and get properties.
pgroup.temperature # Returns the property object. pgroup.temperature.animate(...) # Animate. See Property docs. pgroup.temperature = -273 # Calls pgroup.temperature.set_value()
Properties
- class pianoray.Property(name: str = '', desc: str = '', animatable: bool = True, mods: Sequence[pianoray.api.modifiers.Modifier] = (), default: Optional[Any] = None)
Property base class.
- set_value(value: Any)
Checks validity and sets self._value
- value(frame: int, use_mods: bool = True, default: Optional[pianoray.api.accessor.Accessor] = None) Any
Returns value at frame. Uses keyframe interpolations. Converts to type. Applies modifiers.
- verify(value: Any) bool
Check whether the value can be assigned to this prop, e.g. min and max.
Default implementation returns True. Override in subclass, if applicable.
- class pianoray.BoolProp(name: str = '', desc: str = '', animatable: bool = True, mods: Sequence[pianoray.api.modifiers.Modifier] = (), default: Optional[Any] = None)
Boolean.
- type
alias of
bool
- class pianoray.IntProp(min: Optional[int] = None, max: Optional[int] = None, coords: bool = False, **kwargs)
Integer. Min and max inclusive. Coords: Whether this quantity is in coords.
- type
alias of
int
- verify(value: int) bool
Checks min and max.
- class pianoray.FloatProp(min: Optional[float] = None, max: Optional[float] = None, coords: bool = False, **kwargs)
Float. Min and max inclusive. Coords: Whether this quantity is in coords.
- type
alias of
float
- verify(value: float) bool
Checks min and max.
- class pianoray.StrProp(min_len: Optional[int] = None, max_len: Optional[int] = None, **kwargs)
String. Min and max inclusive.
- type
alias of
str
- verify(value: str) bool
Checks length min and max.
- class pianoray.PathProp(isfile: bool = False, isdir: bool = False, **kwargs)
Path property. Can verify if a path exists.
- verify(value: str) bool
Checks path isfile and isdir, if respective attributes are True.
- class pianoray.ArrayProp(shape: Optional[Tuple[int]] = None, **kwargs)
Numpy array property.
- verify(value: numpy.ndarray) bool
Checks shape.
- class pianoray.RGBProp(**kwargs)
RGB color property, 0 to 255.