Plush

DataCollection#

plupy · Type index

Module: plupy · obtained from plupy.data.objects, plupy.data.scenes, plupy.data.materials, plupy.data.libraries, plupy.data.matter, plupy.data.of_type(kind)

Datablocks of one kind (plupy.data.objects, .scenes, .materials, .libraries, .matter, or plupy.data.of_type(kind)): look up by ID or exact name, iterate, new(name) and delete(block).

class DataCollection(Collection)

Inherits Collection: its members are documented there.

Usage and examples

Derived types: EffectChainCollection · FontCollection · MeshCollection · ModulationChainCollection · PhysicsMaterialCollection · ShaderCollection · ShapeCollection · SoundCollection · SoundSequenceCollection · SpriteCollection

Members: new · delete

new#

new(name: str, **options) -> DataBlock

Creates and returns data. Supported kinds include object, scene, mesh, material, effect, library, style2D, stylesheet2D and compiled project data declarations (data:Namespace.ClassName). A Style 2D's values are its props (style2D.fill, style2D.radius, …); a Stylesheet 2D's text is props["stylesheet2D.source"]. Create custom data with plupy.data.of_type("data:ImpactSettings").new("Heavy impact"), then edit its C# property names through block.props. Mesh creation requires primitive= or generator=; there is no default. Mesh primitives: plane, cube, sphere, cone, cylinder, cube-fine, sphere-fine, plane-fine. Generators build a mesh from numbers (see generated meshes): box, cylinder, tube, elbow, wedge, stairs, grating, panel, ibeam; further keyword arguments set that generator's parameters, for example meshes.new("Drum", generator="cylinder", radius=0.3, height=0.9). Unspecified parameters keep their defaults. Unknown options raise TypeError; unsupported kinds, unknown parameters or invalid values raise PlupyError. Creation does not add scene or Library membership.

Generator parameters (meters unless noted; values outside a range are clamped; every generator also takes uvScale, the texture size in meters per repeat, default 1):

GeneratorParameters (default)Shape
boxsizeX 1, sizeY 1, sizeZ 1, bevel 0Width, height, depth; bevel 0 is sharp
cylinderradius 0.5, topRadius 0.5, height 1, segments 24, capBottom 1, capTop 1Along Y; topRadius 0 is a cone; caps 0/1
tuberadius 0.5, thickness 0.05, height 1, segments 24Open pipe along Y
elbowradius 0.1, bendRadius 0.3, angle 90 (degrees), segments 16, rings 8, capped 0Starts along +Y and bends toward +X
wedgesizeX 1, sizeY 1, sizeZ 1Full height at −Z, sloping down to +Z
stairswidth 2, rise 0.18, run 0.28, steps 8Climbs toward −Z
gratingsizeX 2, sizeZ 1, spacing 0.05, barWidth 0.006, thickness 0.03, crossSpacing 0.2Bars along X
panelsizeX 2, sizeY 3, thickness 0.1, frame 0.1, inset 0.02Faces +Z; frame 0 is flat
ibeamlength 4, height 0.3, flangeWidth 0.15, flangeThickness 0.02, webThickness 0.012Extruded along X

Counts (segments, rings, steps) and switches (capBottom, capTop, capped) are rounded to whole numbers. Every generated mesh is centered on its bounding box. Generate each size you need rather than scaling one unit piece: a placement's scale also stretches the bevel and texture.

delete#

delete(block)

Deletes an unreferenced datablock in this collection. Returns None. A different datablock kind raises TypeError; remaining users cause PlupyError. Dependencies are not deleted recursively.

Collection · DataBlock · Library · Mesh · PlupyError · edit

Source#