Procedural¶
-
class
guerilla.
Procedural
¶ Bases:
guerilla.Primitive
A scriptable procedural 3d renderable object.
A Procedural contains a lua script describing how to subdivide the primitive at render time.
-
Script
¶ The LUA script describing the primitive. This script must be written in the LUA syntax.
LUA{local plugin = {}
- function plugin:getlaabb ()
- return aabb.create (0, 1, 0, 1, 0, 1)
end
- function plugin:subdivide (parameters)
- RiPolygon (“P”, {0,0,0,0,0,1,1,0,1,1,0,0}, “st”, {0,0,0,1,1,1,1,0}, “N”, {0,1,0,0,1,0,0,1,0,0,1,0})
end
- return plugin
}
type: str
-
bake
()¶ Bake the procedural and pass it in “Read” mode. This methods is only for the HairAndFur procedural.
-
static
bakeall
()¶ Bake the procedurals which are marked as Bake
-
baketoarchive
(file)¶ Write the procedural geometry to the given file (only ghostdata and obj files are supported at the moment)
The result of the baking process creates a group containing primitives with the baked shapes.
Parameters: file (str) – The file path to write
-
createref
(parent, name, filename)¶ Create a
ProceduralRef
to a gprocedural fileParameters: - parent (
Node
) – The parent to create the ProceduralRef in - name (str) – The name of the ProceduralRef
- filename (str) – The path to the referenced
Procedural
Returns: The created reference
Return type: ref
- parent (
-
static
forceallbaked
()¶ Force all the procedurals as Bake, then bake tham all, and force them all as Read back.
This function is an alias for Procedural.forcebake with the full list of all bakeable procedurals.
-
static
forcebake
(procedurals=None)¶ Force procedurals to bake their implantation and switch them to Read –
procedurals is a list of path strings or procedural nodes to force baking. Whenno list is provided (nil/None) then all procedurals which are not already set to Read are forced.
param procedurals: The optional list of procedurals to bake – :type procedurals: {
Procedural
or string}
-