Module Metaball :: Class Metaball
[frames | no frames]

Class Metaball


The Metaball object

This metaball gives access to generic data from all metaballs in Blender.
Method Summary
None addMetaelem(paramslist)
Add a new metaelem to this metaball.
a list of 24 floats(8 points, 3 coordinates) getBbox()
Retrieves the bounding box of a metaball object.
a list of 3 floats getLoc()
Retrieves the location of a metaball object.
float getMetadata(name, num)
Retrieves the metadata of a metaball object.
List getMetaElemList()
retreives the list of the Metaelems of the Metaball
float getMetalen(pos)
Retrieves the len parameter of a metaelem object.
float getMetas(pos)
Retrieves the s parameter of a metaelem object.
int getMetatype(pos)
Retrieves the type of a metaelem object.
float getMetax(pos)
Retrieves the x parameter of a metaelem object.
float getMetay(pos)
Retrieves the y parameter of a metaelem object.
float getMetaz(pos)
Retrieves the z parameter of a metaelem object.
string getName()
Retrieves the name of a metaball object.
int getNMetaElems()
Retrieves the number of metaelems (elementary spheres or cylinders) of a metaball object.
float getRendersize()
Retrieves the rendersize of a metaball object.
a list of 3 floats getRot()
Retrieves the rotation of a metaball object.
a list of 3 floats getSize()
Retrieves the size of a metaball object.
float getThresh()
Retrieves the threshold of a metaball object.
float getWiresize()
Retrieves the wiresize of a metaball object.
None setLoc(newloc)
Sets the location of a metaball object.
None setMetadata(name, num, val)
The setMetadata function has the same semantics as getMetadata, except that it needs the parameter value, and always returns None.
None setMetalen(pos, newlen)
Sets the len parameter of a metaelem object.
None setMetas(pos, news)
Sets the s parameter of a metaelem object.
None setMetatype(pos, newtype)
Sets the type of a metaelem object.
None setMetax(pos, newx)
Sets the x parameter of a metaelem object.
None setMetay(pos, newy)
Sets the y parameter of a metaelem object.
None setMetaz(pos, newz)
Sets the z parameter of a metaelem object.
None setName(name)
Sets the name of a metaball object.
None setRendersize(newsize)
Sets the render size of a metaball object.
None setRot(newrot)
Sets the rotation of a metaball object.
None setSize(newsize)
Sets the size of a metaball object.
None setThresh(threshold)
Sets the threshold of a metaball object.
None setWiresize(newsize)
Sets the wire size of a metaball object.

Class Variable Summary
  loc: The location of the metaball.
  name: The name of the metaball.
  rot: The rotation of the metaball.
  size: The size of the metaball.

Method Details

addMetaelem(paramslist)

Add a new metaelem to this metaball. 'paramslist' must have the following ten elements:
  • param 1: int - metaelem type:
    • 0 for a sphere
    • 1 for a tubex
    • 2 for a tubey
    • 3 for a tubez
    • 4 for a regular tube
    • 5 for a plane
    • 6 for an ellipsoid
    • 7 for a cube
  • params 2,3,4: floats - the x, y and z coordinates of the metaelem.
  • param 5: float - the rad value of the metaelem.
  • param 6: int - the lay value.
  • param 7: float - the s value of the metaelem.
  • params 8,9,10: floats - the expx, expy and expz values of the metaelem.
Parameters:
paramslist - the list of the parameters for creating a new metaelem.
           (type=list)
Returns:
None
           (type=None)

getBbox()

Retrieves the bounding box of a metaball object.
Returns:
the bounding box of a metaball object
           (type=a list of 24 floats(8 points, 3 coordinates))

getLoc()

Retrieves the location of a metaball object.
Returns:
location of a metaball object
           (type=a list of 3 floats)

getMetadata(name, num)

Retrieves the metadata of a metaball object. A metaball is composed of one or several elementary objects, spheres or cylinders, which interact to create the smooth surface everybody knows. The get/set Metadata functions allow users to read/write the parameters of these elementary objects, called metaelements.
Parameters:
name - the name of the property to be read. The accepted values are :"type", "x", "y", "z", "expx", "expy", "expz", "rad", "rad2", "s", "len".
           (type=string)
num - the position of the metaelem to be accessed.
           (type=int)
Returns:
the metaelement parameter value, generally a float, except for the parameter "type", which returns an int.
           (type=float)

getMetaElemList()

retreives the list of the Metaelems of the Metaball
Returns:

List of Metaelem classes Each Metaelem object has NO function, but 4 read/write fields

coords : a list of three floats, the coordinates of the Metaelem object

dims : a list of three floats, the dimensions of the meteelem object

rad : a float, the radius of the object

stif : a float, the stifness of the object

Example :

import Blender

mb = Blender.Metaball.Get("mball")

ob = Blender.Object.Get("ob")

ll = mb.getMetaElemList()

me = ll[0]

old = me.coords

new = [old[0],old[1],old[2]-.02]

me.coords = new

ob.makeDisplayList()

Blender.Window.QRedrawAll()
           (type=List)

getMetalen(pos)

Retrieves the len parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
len parameter of the metaelem object
           (type=float)

getMetas(pos)

Retrieves the s parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
s parameter of the metaelem object
           (type=float)

getMetatype(pos)

Retrieves the type of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
type of the metaelem object
           (type=int)

getMetax(pos)

Retrieves the x parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
x parameter of the metaelem object
           (type=float)

getMetay(pos)

Retrieves the y parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
y parameter of the metaelem object
           (type=float)

getMetaz(pos)

Retrieves the z parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
Returns:
z parameter of the metaelem object
           (type=float)

getName()

Retrieves the name of a metaball object.
Returns:
the name of a metaball object.
           (type=string)

getNMetaElems()

Retrieves the number of metaelems (elementary spheres or cylinders) of a metaball object.
Returns:
number of metaelems of a metaball object
           (type=int)

getRendersize()

Retrieves the rendersize of a metaball object.
Returns:
render size a metaball object
           (type=float)

getRot()

Retrieves the rotation of a metaball object.
Returns:
rotation of a metaball object
           (type=a list of 3 floats)

getSize()

Retrieves the size of a metaball object.
Returns:
size a metaball object
           (type=a list of 3 floats)

getThresh()

Retrieves the threshold of a metaball object.
Returns:
threshold of the metaball object
           (type=float)

getWiresize()

Retrieves the wiresize of a metaball object.
Returns:
wire size a metaball object
           (type=float)

setLoc(newloc)

Sets the location of a metaball object.
Parameters:
newloc - the new location
           (type=list of 3 floats)
Returns:
None
           (type=None)

setMetadata(name, num, val)

The setMetadata function has the same semantics as getMetadata, except that it needs the parameter value, and always returns None.
Parameters:
name - the name of the property to be read. The accepted values are :"type", "x", "y", "z", "expx", "expy", "expz", "rad", "rad2", "s", "len".
           (type=string)
num - the position of the metaelem to be accessed.
           (type=int)
val - the new value of the parameter.
           (type=float, except if name is "type".)
Returns:
None
           (type=None)

setMetalen(pos, newlen)

Sets the len parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
newlen - the new x parameter value
           (type=float)
Returns:
None
           (type=None)

setMetas(pos, news)

Sets the s parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
news - the new x parameter value
           (type=float)
Returns:
None
           (type=None)

setMetatype(pos, newtype)

Sets the type of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
newtype - the new type
           (type=int)
Returns:
None
           (type=None)

setMetax(pos, newx)

Sets the x parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
newx - the new x parameter value
           (type=float)
Returns:
None
           (type=None)

setMetay(pos, newy)

Sets the y parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
newy - the new y parameter value
           (type=float)
Returns:
None
           (type=None)

setMetaz(pos, newz)

Sets the z parameter of a metaelem object.
Parameters:
pos - the position of the metaelement
           (type=int)
newz - the new z parameter value
           (type=float)
Returns:
None
           (type=None)

setName(name)

Sets the name of a metaball object.
Parameters:
name - the new name
           (type=string)
Returns:
None
           (type=None)

setRendersize(newsize)

Sets the render size of a metaball object.
Parameters:
newsize - the new size
           (type=float)
Returns:
None
           (type=None)

setRot(newrot)

Sets the rotation of a metaball object.
Parameters:
newrot - the new rotation
           (type=list of 3 floats)
Returns:
None
           (type=None)

setSize(newsize)

Sets the size of a metaball object.
Parameters:
newsize - the new size
           (type=list of 3 floats)
Returns:
None
           (type=None)

setThresh(threshold)

Sets the threshold of a metaball object.
Parameters:
threshold - the new size
           (type=float)
Returns:
None
           (type=None)

setWiresize(newsize)

Sets the wire size of a metaball object.
Parameters:
newsize - the new size
           (type=float)
Returns:
None
           (type=None)

Class Variable Details

loc

The location of the metaball.

name

The name of the metaball.

rot

The rotation of the metaball.

size

The size of the metaball.

Generated by Epydoc 2.1 on Thu Aug 12 21:47:29 2004 http://epydoc.sf.net