Plush

Data#

plupy · Type index

Module: plupy · obtained from plupy.data

plupy.data: the project's datablocks by kind (objects, scenes, meshes, materials, sounds, …), each a collection to look up, create, import and delete in. Works in the editor and headlessly, without a selection.

PropertyItem typeCreation
data.objectsObjectEmpty object
data.scenesSceneEmpty scene
data.meshesMeshPrimitive or generated mesh, or import_file(path) for a .glb model
data.spritesDataBlockimport_file(path) only: an image for materials and 2D
data.materialsDataBlockMaterial
data.shadersShadernew(name, surface_model="lit") or new_slang(name, source=..., parameters=...)
data.librariesLibraryLibrary
data.matterDataBlockMatter substance (density, toughness…; set with props) for the matter component
data.shapesDataBlockPhysics shape: new(fit=…) or new(kind=…)
data.physics_materialsDataBlockPhysics material (friction, restitution)
data.fontsDataBlockimport_file(path) only
data.soundsSoundimport_file(path), import_soundfont(path), or new(name) for an empty Sound to fill with keyzones
data.modulation_chainsModulationChainnew(name); add, set, remove envelopes
data.effect_chainsEffectChainnew(name); add, set, move, remove audio effects
data.sound_sequencesSoundSequencenew(name, text=None); edited as text; import_midi(path, …)
class Data

Usage and examples

Members: objects · scenes · meshes · sprites · materials · shaders · libraries · matter · shapes · physics_materials · fonts · sounds · sound_sequences · modulation_chains · effect_chains · of_type · unused · purge_unused

objects#

objects = DataCollection('object')

A class attribute shared by every instance.

scenes#

scenes = DataCollection('scene')

A class attribute shared by every instance.

meshes#

meshes = MeshCollection()

A class attribute shared by every instance.

sprites#

sprites = SpriteCollection()

A class attribute shared by every instance.

materials#

materials = DataCollection('material')

A class attribute shared by every instance.

shaders#

shaders = ShaderCollection()

A class attribute shared by every instance.

libraries#

libraries = DataCollection('library')

A class attribute shared by every instance.

matter#

matter = DataCollection('matter')

A class attribute shared by every instance.

shapes#

shapes = ShapeCollection('physicsShape')

A class attribute shared by every instance.

physics_materials#

physics_materials = PhysicsMaterialCollection('physicsMaterial')

A class attribute shared by every instance.

fonts#

fonts = FontCollection()

A class attribute shared by every instance.

sounds#

sounds = SoundCollection()

A class attribute shared by every instance.

sound_sequences#

sound_sequences = SoundSequenceCollection()

A class attribute shared by every instance.

modulation_chains#

modulation_chains = ModulationChainCollection()

A class attribute shared by every instance.

effect_chains#

effect_chains = EffectChainCollection()

A class attribute shared by every instance.

of_type#

of_type(kind: str) -> DataCollection

Returns a collection filtered by an exact datablock kind string. An unknown kind returns an empty collection. Compiled C# data declarations use data:Namespace.ClassName and support .new(name). Other kinds support creation only where documented on their collection.

unused#

unused() -> tuple[DataBlock, ...]

Datablocks nothing refers to (scenes and libraries are never listed).

Returns datablocks nothing refers to: no scene, object, Library entry, component or other datablock uses them. Scenes and libraries are roots and are never listed; the project's default physics material and its collision layers are kept. Writes nothing.

purge_unused#

purge_unused() -> str

Delete every unused datablock (and what that frees) in one undo step; returns a summary.

Deletes every unused datablock, then whatever that frees in turn (a controller's states, then their clips), in one Undo step, and returns a summary such as "Purged 3 unused datablocks: 2 mesh, 1 material. Undo restores them.". Data files go with them; source assets (models, images, fonts) stay. It covers the whole project: a builder script that shares a project with other authored content should delete the datablocks it owns instead.

DataBlock · DataCollection · EffectChain · EffectChainCollection · FontCollection · Library · Mesh · MeshCollection · ModulationChain · ModulationChainCollection · Object · PhysicsMaterialCollection · Property · Scene · Shader · ShaderCollection · ShapeCollection · Sound · SoundCollection · SoundSequence · SoundSequenceCollection · SpriteCollection

Source#