Note New object type has to be already supported by the K3D JS provider (see: How to add loader strategy for new object type).
-
Add a new object class in
k3d/objects.py
The new class has to:
- have a name matching an object type in k3d
- have a read-only
type
class variable, of typetraitlets.Unicode
with the default value set to the above name - extend
k3d.objects.Drawable
- define a list of class variables, each derived from the
traitlets.TraitType
class
-
Add a new helper function in
k3d/factory.py
This new function should:
- have a name matching the object type in k3d using lower_case_with_underscores notation
- accept arbitrary arguments
- return an instance of the class created in #1