PRIS Modeler: LightWave Modeler Interfaces

This module encapsulates functionality intended for use with LightWave Modeler’s SDK interface.

Return Codes

Aside from possibly throwing Exceptions when arguments fail to match expectations, many functions in the PRIS Modeler module will return a “result” code.

Functions based on CommandSequence commands will return an integer code that corresponds to one of the following values:

  • lwsdk.CSERR_NONE (0)
  • lwsdk.CSERR_MEMORY
  • lwsdk.CSERR_IO
  • lwsdk.CSERR_USERABORT
  • lwsdk.CSERR_ARGCOUNT
  • lwsdk.CSERR_ARGTYPE
  • lwsdk.CSERR_ARGVALUE
  • lwsdk.CSERR_OPFAILURE
  • lwsdk.CSERR_BADSEL

MeshEdit commands will return an integer code that corresponds to one of the following values:

  • lwsdk.EDERR_NONE (0)
  • lwsdk.EDERR_NOMEMORY
  • lwsdk.EDERR_BADLAYER
  • lwsdk.EDERR_BADSURF
  • lwsdk.EDERR_USERABORT
  • lwsdk.EDERR_BADVMAP
  • lwsdk.EDERR_BADARGS

A result of one of the “zero” codes (lwsdk.CSERR_NONE or lwsdk.EDERR_NONE) means the function completed successfully. Any other “non-zero” result indicates an error of some kind.

lwsdk.pris.modeler.addcurve(points, surface='Default')

Adds new curve to a mesh, constructed from the provided point ids.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also addpoint()

Parameters:
  • points (sequence[pointid]) – A sequence of point ids from which to construct the new curve.
  • surface (str) – The optional name of a surface the new curve should use.
Returns:

polyid: The id of the curve added; None if the operation fails.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.addpoint(point)

Adds new vertices to a mesh.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

Parameters:point (lwsdk.Vector, sequence[3]) – The position in 3D space where the new vertex should be placed.
Returns:pointid: The id of the vertex added; None if the operation fails.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.addpolygon(points, surface='Default')

Adds new polygon to a mesh, constructed from the provided point ids.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also addpoint()

Parameters:
  • points (sequence[pointid]) – A sequence of point ids from which to construct the new polygon.
  • surface (str) – The optional name of a surface the new polygon should use.
Returns:

polyid: The id of the polygon added; None if the operation fails.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.addquad(points, arg2=None, arg3=None, arg4=None)

Adds new quad polygon to a mesh, constructed from provided point ids.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also addpoint()

Parameters:
  • points (pointid, sequence[pointid]) – A point id (or sequence of 4 point ids) from which to construct the new polygon.
  • arg2 (pointid) – The optional second point id
  • arg3 (pointid) – The optional third point id
  • arg4 (pointid) – The optional fourth point id
Returns:

polyid: The id of the polygon added; None if the operation fails.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.addtriangle(points, arg2=None, arg3=None)

Adds new triangle polygon to a mesh, constructed from provided point ids.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also addpoint()

Parameters:
  • points (pointid, sequence[pointid]) – A point id (or sequence of 3 point ids) from which to construct the new triangle.
  • arg2 (pointid) – The optional second point id
  • arg3 (pointid) – The optional third point id
Returns:

polyid: The id of the polygon added; None if the operation fails.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.alignpols()

Flip polygons so that they all face in the “same” direction to form a coherent mesh.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.autoflex(axis, polarity, ease=None)

Set the flex functions to operate on an automatic range along an axis of the given polarity.

See also fixedflex()

Parameters:
  • axis (str) – The axis to use, one of ‘X’, ‘Y’ or ‘Z’.
  • polarity (str) – The directional hint, one of ‘+’ or ‘-‘.
  • ease (str) – Optional ease hint, one of ‘i’, ‘o’ or ‘io’.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.axisdrill(operation, axis, surface=None)

Slice the foreground geometry using a 2D template or 3D shape in the background layer.

See also soliddrill()

Parameters:
  • operation (str) – The operation to perform, one of ‘CORE’, ‘TUNNEL’, ‘SLICE’ or ‘STENCIL’.
  • axis (str) – The axis across which to drill, one of ‘X’, ‘Y’ or ‘Z’.
  • surface (str) – The optional surface name to apply to the newly created geometry.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.bend(angle, direction, center=None)

Bend points by the given bend angle in the direction around the optional center, using the currently defined flex axis.

See also bend2()

Parameters:
  • angle (float) – The angle of the bend, in degrees.
  • direction (float) – The direction of the bend.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.bend2(angle, direction, center=None)

Bend points by the given bend angle in the direction around the optional center, using the currently defined flex axis.

See also bend()

Parameters:
  • angle (float) – The angle of the bend, in radians.
  • direction (float) – The direction of the bend.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.bevel(inset, shift)

Create a beveled edge around each selected polygon.

See also shapebevel()

Parameters:
  • inset (float) – The distance to move the polygon’s edges inward.
  • shift (float) – The distance to offset the polygon by its normal.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.boolean(action='INTERSECT')

Combine geometry in the foreground and background to create a new shape.

Parameters:action (str) – The Boolean action to perform, one of ‘UNION’, ‘SUBTRACT’, ‘INTERSECT’, or ‘ADD’.
Returns:tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.boundingbox(layers=None)

Calulates the bounding volume that would contain the currently visible mesh.

Parameters:layers (sequence[str|int]) – An optional list of layers to use for the calculation. If omitted, the currently selected layers are used.
Returns:tuple(lwsdk.Vector, lwsdk.Vector): The low and high points of the bounding volume.
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.changepart(name)

Set the part tag for selected polygons.

Parameters:name (str) – The name of the part.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.changesurface(surface)

Sets the surface of the selected polygon(s).

Parameters:surface (str) – The name of the surface.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.close()

Closes the current object.

See also load(), save(), closeall()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.closeall()

Closes all objects.

See also load(), save(), close()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.copy()

Copies the selected geometry to Modeler’s clipboard.

See also delete(), cut(), paste()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.copysurface(from_name, to_name)

Copy the settings of one surface to another.

Parameters:
  • from_name (str) – The name of the source surface.
  • to_name (str) – The name of the destination surface (must already exist; see createsurface()).
Returns:

int: The result code.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.cut()

Removes the selected geometry, placing it in Modeler’s clipboard.

See also delete(), copy(), paste()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.deformregion(radius, center=None, axis=None)

Set the area of effect for the deformation tools.

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The bounds of the area of effect.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
  • axis (str) – The optional axis to use, one of ‘X’, ‘Y’ or ‘Z’. If omitted, the effect is bounded in all directions by the given radius. If specified, the effect is unbounded along that axis.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.delete()

The delete command removes the selected geometry without placing it in Modeler’s clipboard.

See also cut(), copy(), paste()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.editbegin()

Initialize a mesh-edit operation on the current object.

See also editend()

Returns:bool: True if the edit session has begun, otherwise False
Raises :Nothing
lwsdk.pris.modeler.editend(result=0)

Conclude an active mesh-edit operation.

See also editbegin()

Parameters:result (int) – lwsdk.EDERR_NONE (default) if the changes should be applied to the mesh, otherwise lwsdk.USER_ABORT should be provided to discard any pending changes.
Returns:Nothing
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.exit()

Terminates Modeler.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.extrude(axis, thickness)

Extrudes the selected mesh along the specified axis to the requested thickness.

See also addpoint()

Parameters:
  • points (sequence[pointid]) – A sequence of point ids from which to construct the new curve.
  • surface (str) – The optional name of a surface the new curve should use.
Returns:

polyid: The id of the curve added; None if the operation fails.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.fixedflex(axis, start, end, ease=None)

Set the flex functions to operate on a fixed range along an axis.

See also autoflex()

Parameters:
  • axis (str) – The axis to use, one of ‘X’, ‘Y’ or ‘Z’.
  • start (float) – Start of the range.
  • end (float) – End of the range.
  • ease (str) – Optional ease hint, one of ‘i’, ‘o’ or ‘io’.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.flip()

Flip the sidedness (reverse the surface normals) of faces and the directions of curves.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.fontclear(index)

Remove the font at the given index from Modeler.

Parameters:index (int) – The index of the font to remove.
Returns:Nothing
Raises :Nothing
lwsdk.pris.modeler.fontcount()

Returns the number of fonts currently available in Modeler.

Returns:int: The number of fonts available.
Raises :Nothing
lwsdk.pris.modeler.fontindex(name)

Returns the linear index of the font with the given name.

Parameters:name (str) – The font name to locate.
Returns:int: The index of the named font, or -1 if it could not be found.
Raises :Nothing
lwsdk.pris.modeler.fontload(filename)

Load a font from a disc file.

Parameters:filename (str) – The file that contains the Postscript Type 1 font data
Returns:int: The index of the loaded font, or -1 if the load failed.
Raises :Nothing
lwsdk.pris.modeler.fontname(index)

Returns the name of the font occupying the slot indicated.

Parameters:index (int) – The index into the list of available fonts.
Returns:str: The name of the font.
Returns:None: If the index value is out of range.
Raises :Nothing
lwsdk.pris.modeler.fracsubdivide(mode, fractal, maxangle=None)

Split triangles into four smaller triangles and quads into four smaller quads, applying a fractal displacement to each new vertex as a function of its position.

See also subdivide()

Parameters:
  • mode (str) – The mode of the subdivide, one of ‘FLAT’, ‘SMOOTH’ or ‘METAFORM’.
  • fractal (float) – The displacement to apply.
  • maxangle (float) – The optional maximum angle, in degrees, beyond which normals will not be interpolated.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.freezecurves()

Convert curves into polygons.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.getdefaultsurface()

Returns the name of the surface that will be assigned to new geometry.

Returns:str: The name of the surface.
lwsdk.pris.modeler.getpoints()

Retrieves all point ids currently “visible” in the selected foreground layers.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also getpolygons()

Returns:tuple(pointid): A sequence of the visible point ids in the current foreground layers.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.getpolygons()

Retrieves all polygon ids currently “visible” in the selected foreground layers.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also getpoints()

Returns:tuple(polyid): A sequence of the visible polygon ids in the current foreground layers.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.init(mc)

The PRIS Modeler module must be initialized before it can be used. Initialization consists simply of providing the layer with the LWModCommand value passed into your script. Using this, PRIS can then perform functions on your behalf.

Parameters:mc (LWModCommand) – This should be the LWModCommand value provided to your script, or returned by the lwsdk.ModCommand() function in a “single-shot” script.
Returns:bool: True if the module initialized successfully, False otherwise
Raises :Nothing
lwsdk.pris.modeler.inituv(values)

Set the texture UV for a point or polygon you’re about to create.

Parameters:values (sequence[float]) – A sequence of float coordinates (in pairs, so the size is expected to be a multiple of two) with which to initialze the UV.
Returns:int: The result code.
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.jitter(radius, type=None, center=None)

Randomly translate points using different displacement functions.

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the jitter.
  • type (str) – The optional type of the jitter, one of ‘UNIFORM’ (default), ‘GAUSSIAN’, ‘NORMAL’, or ‘RADIAL’
  • center (lwsdk.Vector, sequence[3]) – Optional center point for use with the ‘RADIAL’ jitter type.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.lathe(axis, sides, center=None, endangle=None, startangle=None, offset=None)

Spin a template around an axis.

Parameters:
  • axis (str) – The axis of the effect, one of ‘X’, ‘Y’ or ‘Z’.
  • sides (int) – The number of resulting sides (or segments).
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
  • endangle (float) – The optional end angle of the effect, in degrees.
  • startangle (float) – The optional start angle of the effect, in degrees.
  • offset (float) – An optional offset.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.load(filename)

Loads a mesh object from disc.

Parameters:filename (str) – The path to the file containing the mesh to load.
Returns:tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.lyrbg()

Returns a list of the background layers, which are inactive but still displayed.

See also lyrfg(), lyrempty(), lyrdata()

Returns:list[str]: A list of string layer numbers selected for background editing.
Raises :Nothing
lwsdk.pris.modeler.lyrdata()

Returns a list of non-empty layers which contain some data (the complement of lyrempty()).

See also lyrfg(), lyrbg(), lyrempty()

Returns:list[str]: A list of string layer numbers that contain geometry.
Raises :Nothing
lwsdk.pris.modeler.lyrempty()

Returns a list of empty layers that contain no geometry.

See also lyrfg(), lyrbg(), lyrdata()

Returns:list[str]: A list of string layer numbers that have no geometry.
Raises :Nothing
lwsdk.pris.modeler.lyremptybg()

Returns a list of background layers that contain no data.

See also lyremptyfg()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.lyremptyfg()

Returns a list of foreground layers that contain no data.

See also lyremptybg()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.lyrfg()

Returns a list of the foreground layers, which are active and displayed.

See also lyrbg(), lyrempty(), lyrdata()

Returns:list[str]: A list of string layer numbers selected for foreground editing.
Raises :Nothing
lwsdk.pris.modeler.lyrsetbg(layers)

Sets the current background layers.

See also lyrsetfg(), lyrswap()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.lyrsetfg(layers)

Sets the current foreground layers.

See also lyrsetbg(), lyrswap()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.lyrswap()

Invert the current layer configuration – foreground layers become background, and vice versa.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.magnet(offset, arg2=None, arg3=None)

Translate points within the defined deform region.

See also move(), shear()

Parameters:
  • offset (lwsdk.Vector, sequence[3], float) – The amount to translate, or the ‘X’ distance if a float is provided.
  • arg2 (float) – The ‘Y’ component of the offset if the first parameter is also a float.
  • arg3 (float) – The ‘Z’ component of the offset if the first parameter is also a float.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.make4patch(perp, para)

Create a quad mesh from three or four curves.

Parameters:
  • perp (int) – The number of segments that will be created in the perpendicular direction.
  • para (int) – The number of segments that will be created in the parallel direction.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled, or selection mode is not valid)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.makeball(radius=[0.5, 0.5, 0.5], nsides=24, segments=12, center=None)

Creates a ball primitive in the current foreground object layers.

See also makebox(), makedisc(), makecone()

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the ball.
  • nsides (int) – The number of sides the ball should have.
  • segments (int) – The number of segments the ball should have.
  • center (lwsdk.Vector, sequence[3]) – The center of the new ball.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.makebox(lowpoint=[-0.5, -0.5, -0.5], highpoint=[0.5, 0.5, 0.5], segments=None)

Creates a six-sided box primitive in the current foreground object layers.

See also makedisc(), makeball(), makecone()

Parameters:
  • lowpoint (lwsdk.Vector, sequence[3]) – The low vector of the box.
  • highpoint (lwsdk.Vector, sequence[3]) – The high vector of the box.
  • segments (lwsdk.Vector, sequence[3]) – The number of seqments to create on each axis (default 1).
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.makecone(radius, top, bottom, axis, nsides, segments=None, center=None)

Creates a cone primitive in the current foreground object layers.

See also makebox(), makeball(), makedisc()

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the bottom of the cone.
  • top (float) – Location (along ‘axis’) of the top of the cone.
  • bottom (float) – Location (along ‘axis’) of the bottom of the cone.
  • axis (str) – The axis along which to create the cone, one of ‘X’, ‘Y’, or ‘Z’.
  • nsides (int) – The number of sides the cone should have.
  • segments (int) – The number of segments the cone should have.
  • center (lwsdk.Vector, sequence[3]) – The center of the new cone.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.makedisc(radius, top, bottom, axis, nsides, segments=None, center=None)

Creates a disc primitive in the current foreground object layers.

If top != bottom, then this function creates a cylinder.

See also makebox(), makeball(), makecone()

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the disc.
  • top (float) – Location (along ‘axis’) of the top of the disc.
  • bottom (float) – Location (along ‘axis’) of the bottom of the disc.
  • axis (str) – The axis along which to create the disc, one of ‘X’, ‘Y’, or ‘Z’.
  • nsides (int) – The number of sides the disc should have.
  • segments (int) – The number of segments the disc should have.
  • center (lwsdk.Vector, sequence[3]) – The center of the new disc.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.maketesball(radius, level=0, center=None)

Creates a ball primitive in the current foreground object layers.

The level value divides the edges of the icosahedron into 2^level segments.

See also maketesball2()

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the ball.
  • level (int) – The tesselation level of the ball (0 = icosahedron).
  • center (lwsdk.Vector, sequence[3]) – The center of the new ball.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.maketesball2(radius, segments, center=None)

Creates a ball primitive in the current foreground object layers using an arbitrary number of segments.

See also maketesball()

Parameters:
  • radius (lwsdk.Vector, sequence[3]) – The radius of the ball.
  • segments (int) – The segmentation level of the ball.
  • center (lwsdk.Vector, sequence[3]) – The center of the new ball.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.maketext(text, font, corner=None, kern=None, scale=None, axis=None, pos=None)

Generates mesh based on a string of text.

See also maketext2(), fontindex()

Parameters:
  • text (str) – The text string to render.
  • font (int) – The index (beginning at 1) of a loaded font, upon which to base the mesh.
  • corner (str) – The corner type to use, one of ‘SHARP’ or ‘BUFFERED’.
  • kern (float) – An additional distance to put between characters (normally 0.0).
  • scale (float) – Set the approximate height of the character cell, in meters.
  • axis (str) – Defines the plane in which the text will lie, one of ‘X’, ‘Y’, or ‘Z’.
  • pos (lwsdk.Vector, sequence[3]) – The text will extend to the right of this 3D position.
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.maketext2(text, font, corner=None, kern=None, scale=None, axis=None, pos=None, alignment=None)

Generates mesh based on a string of text.

The primary difference between this function and maketext() is the ability to specify the text alignment.

See also maketext(), fontindex()

Parameters:
  • text (str) – The text string to render.
  • font (int) – The index (beginning at 1) of a loaded font, upon which to base the mesh.
  • corner (str) – The corner type to use, one of ‘SHARP’ or ‘BUFFERED’.
  • kern (float) – An additional distance to put between characters (normally 0.0).
  • scale (float) – Set the approximate height of the character cell, in meters.
  • axis (str) – Defines the plane in which the text will lie, one of ‘X’, ‘Y’, or ‘Z’.
  • pos (lwsdk.Vector, sequence[3]) – The text will extend to the right of this 3D position.
  • alignment (str) – Aligns the text relative to ‘pos’, one of ‘LEFT’, ‘RIGHT’ or ‘CENTER’
Returns:

tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.mergepoints(tolerance=None)

Merge points lying within a certain minimum distance of each other.

If no distance is given, it is computed heuristically.

Parameters:tolerance (float) – The minimum distance to consider.
Returns:tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.mergepols()

Merge selected polygons into a single polygon.

Note that each selected polygon must share at least one edge with another.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.mirror(axis, plane)

Mirrors the selected geometry.

Parameters:
  • axis (str) – The axis across which to mirror the data, one of ‘X’, ‘Y’ or ‘Z’.
  • plane (float) –
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.morphpols(segments)

Create a triangle mesh that connects exactly two polygons with the same number of vertices. The new mesh is divided into a number of segments along the line connecting the two original polygons.

Parameters:segments (int) – The number of segments to create.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.move(offset, arg2=None, arg3=None)

Translate points by the given offset.

See also shear(), magnet()

Parameters:
  • offset (lwsdk.Vector, sequence[3], float) – The amount to translate, or the ‘X’ distance if a float is provided.
  • arg2 (float) – The ‘Y’ component of the offset if the first parameter is also a float.
  • arg3 (float) – The ‘Z’ component of the offset if the first parameter is also a float.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.new()

Creates a new, empty mesh object in Modeler.

Returns:tuple(int, Mesh): The result code, and an instance of the Mesh class that represents the current mesh on success.
lwsdk.pris.modeler.nextsurface(name=None)

Returns the surface identifier that follows the one provided. This is used to iterate over the list of curerntly defined surfaces.

Parameters:name (str) – The name of the current surface to follow. If not provided, the first surface is returned.
Returns:int: The result code.
Returns:None: If the end of the list has been reached.
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.paste()

Pastes previously copied geometry from Modeler’s clipboard.

See also delete(), cut(), copy()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.pathclone(filename, step=None, start=None, end=None)

Load a motion file and clone the selected data along the path in the file.

Creates copies of the selected geometry at intervals along the path.

Parameters:
  • filename (str) – The file that contains the motion data to use.
  • step (float) – A step interval.
  • start (float) – The start time.
  • end (float) – The end time.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled, or selection mode is not valid)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.pathextrude(filename, step=None, start=None, end=None)

Load a motion file and extrude the selected data along the path in the file.

Parameters:
  • filename (str) – The file that contains the motion data to use.
  • step (float) – A step interval.
  • start (float) – The start time.
  • end (float) – The end time.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.plugin(filename, klass=None, name=None, username=None)

Install the plug-ins contained in a .p file.

Parameters:
  • filename (str) – The path to the plug-in file.
  • klass (str) – The optional class of plug-in (e.g., lwsdk.LWMASTER_HCLASS).
  • name (str) – The optional internal name of the plug-in.
  • username (str) – The optional (visible) user name of the plug-in.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.pointcount()

Returns the number of vertices contained in the current foreground layer(s).

Returns:int: The number of visible vertices in the current foreground layer(s).
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.pointinfo(pntid)

Returns the 3D position of the provided point identifier.

Parameters:pntid (pointid) – A valid point identifier for the current mesh.
Returns:lwsdk.Vector: The position in 3D space of the vertex represented by the point identifier.
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.pointmove(point, pos)

Move a point in a new location.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

Parameters:
  • point (pointid) – A point identifier valid for the current mesh.
  • pos (lwsdk.Vector, sequence[3]) – A vector representing the new location.
Returns:

int: The result code.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.pole(amount, center=None)

Scale points by the given factors around the given center, governed by the defined flex axis.

See also scale(), taper()

Parameters:
  • amount – The amount of the scale effect.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.polycount()

Returns the number of polygons contained in the current foreground layer(s).

Returns:int: The number of visible polygons in the current foreground layer(s).
Raises :pris.InitException (if a valid mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.polyinfo(poly)

Returns information about the provided polygon identifier.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also polypointinfo(), polynormal()

Parameters:poly (polyid) – A polygon id from the current mesh.
Returns:sequence[str, pointid, ...]: A sequence whose first member is the surface name currently assigned to the polygon, followed by one or more point ids that comprise the polygon.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
Raises :pris.InitException (if information could not be acquired for the polygon)
lwsdk.pris.modeler.polynormal(polygon)

Returns the normal vector of the provided polygon.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also polyinfo(), polypointinfo()

Parameters:poly (polyid) – A polygon id from the current mesh.
Returns:(result, lwsdk.Vector|None): Result is 0 if the polygon has fewer than three vertices, or is somehow degenerate; otherwise, result is 1 and the vector is valid.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.polypointinfo(polygon)

Returns the number of points used to create the provided polygon identifier.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also polyinfo(), polynormal()

Parameters:poly (polyid) – A polygon id from the current mesh.
Returns:int: The number of points in the polygon.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
Raises :pris.InitException (if information could not be acquired for the polygon)
lwsdk.pris.modeler.polypoints(poly, points)

Replace the point list of a polygon.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

Parameters:
  • poly (polyid) – A polygon identifier valid for the current mesh.
  • surface (str) – The name of the new surface.
Returns:

int: The result code.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.polysurface(poly, surface)

Change the surface assigned to a polygon.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

Parameters:
  • poly (polyid) – A polygon identifier valid for the current mesh.
  • surface (str) – The name of the new surface.
Returns:

int: The result code.

Raises :

pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.quantize(size)

Snap all points to a 3D grid defined by the size vector.

Parameters:size (lwsdk.Vector, sequence[3]) – The size of the grid.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.railclone(segments, divs=None, flags=None, strength=None)

Clone selected data along one or more rails (curves) in background layers.

Parameters:
  • segments (int) – The resulting number of segments. If zero, the number of segments is computed automatically.
  • divs (str) – If segments is non-zero, this value specifies the interval types, one of ‘KNOTS’ (equal number of segments between each curve vertex) or ‘LENGTHS’ (spaced at equal intervales along the curve).
  • flags (str) – Can be ‘o’ for oriented, ‘s’ for scaled, or ‘os’ for both.
  • strength (float) –
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.railextrude(segments, divs=None, flags=None, strength=None)

Extrude selected data along one or more rails (curves) in background layers.

Parameters:
  • segments (int) – The resulting number of segments. If zero, the number of segments is computed automatically.
  • divs (str) – If segments is non-zero, this value specifies the interval types, one of ‘KNOTS’ (equal number of segments between each curve vertex) or ‘LENGTHS’ (spaced at equal intervales along the curve).
  • flags (str) – Can be ‘o’ for oriented, ‘s’ for scaled, or ‘os’ for both.
  • strength (float) –
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.redo()

Re-applies the most recent modification reversion.

See also undo()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.removepols()

Delete polygons, leaving behind their vertices as points.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.rempoint(point)

Deletes the indicated point.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also rempoly()

Parameters:point (pointid) – A point identifier valid for the current mesh.
Returns:int: The result code.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.rempoly(poly)

Deletes the indicated polygon.

Note that this function requires an active mesh-edit operation, otherwise an Exception is raised.

See also rempoint()

Parameters:poly (polyid) – A polygon identifier valid for the current mesh.
Returns:int: The result code.
Raises :pris.InitException (if a mesh-edit operation, begun with editbegin(), is not active)
lwsdk.pris.modeler.renamesurface(old_name, new_name)

Renames an existing surface.

Parameters:
  • old_name (str) – The name of an existing surface.
  • new_name (str) – The new name of the surface.
Returns:

surfid: The surface id of the newly created surface (or the id of a pre-existing surface with the same name).

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.revert(filename=None)

Reload an existing object file, possibly losing any modifications.

Parameters:filename (str) – The path to the file that will replace the current mesh data.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.rotate(angle, axis, center=None)

Rotate points along the given axis by the given angle, in degrees.

See also twist(), vortex()

Parameters:
  • angle (float) – The angle of rotation, in degrees.
  • axis (str) – The axis of the effect, one of ‘X’, ‘Y’ or ‘Z’.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.save(filename)

Saves a mesh object to the specified disc file.

Parameters:filename (str) – The path to the file that will contain the mesh object data.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.scale(amount, center=None)

Scale points by the given factors around the given center.

See also pole(), taper()

Parameters:
  • amount – The amount of the scale effect.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.selectvmap(type, name=None)

Set the current vertex map of a given type.

Parameters:
  • type (str) – The type of the VMap to select, one of ‘MORF’, ‘SPOT’, ‘WGHT’, ‘MNVW’, or ‘TXUV’
  • name (str) – The optional name of the VMap to select. If not specified, then any currently selected VMaps of the specified type will be unselected.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.selhide(data='SELECTED')

Hide data from view.

Parameters:data (str) – The type of data to hide, one of ‘SELECTED’ or ‘UNSELECTED’.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.selinvert()

Inverts the current selection.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.selmode(mode=1)

Set the active selection mode for use by subsequent commands.

Parameters:mode (int) – One of lwsdk.OPSEL_USER (default), lwsdk.OPSEL_DIRECT, lwsdk.OPSEL_GLOBAL, or lwsdk.OPSEL_MODIFY
Returns:Nothing
Raises :Nothing
lwsdk.pris.modeler.selpoint(major, minor, *args)

Modify point selection using various techniques.

See also selpolygon()

Parameters:
  • major (str) – The major mode, one of ‘SET’ or ‘CLEAR’.
  • minor (str) – The minor mode, one of ‘VOLUME’, ‘NPEQ’, ‘NPLT’, ‘NPGT’, ‘POINTNDX’, ‘POINTID’, ‘CONNECT’
  • args (varies) – The remaining arguments provided (if any) have types and counts that depend on the minor mode selection.
Returns:

int: The result code.

Raises :

pris.InitException (if a mesh-edit operation, if required, could not be initiated)

Raises :

pris.InitException (if the current selection mode is not one of OPSEL_USER or OPSEL_DIRECT)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.selpolygon(major, minor, *args)

Modify polygon selection using various techniques.

See also selpoint()

Parameters:
  • major (str) – The major mode, one of ‘SET’ or ‘CLEAR’.
  • minor (str) – The minor mode, one of ‘VOLEXCL’, ‘VOLINCL’, ‘NVEQ’, ‘NVLT’, ‘NVGT’, ‘SURFACE’, ‘NONPLANAR’, ‘POLYID’, ‘POLYNDX’, ‘PART’. ‘CONNECT’, ‘NONPLANAR’, ‘FACE’, ‘CURVE’, ‘BONE’, ‘SKELEGON’, ‘PATCH’, ‘MBALL’
  • args (varies) – The remaining arguments provided (if any) have types and counts that depend on the minor mode selection.
Returns:

int: The result code.

Raises :

pris.InitException (if a mesh-edit operation, if required, could not be initiated)

Raises :

pris.InitException (if the current selection mode is not one of OPSEL_USER or OPSEL_DIRECT)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.selunhide()

Reveals all previously hidden data.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.setlayername(name)

Set the name of the current layer.

Parameters:name (str) – The new name of the active layer.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.setobject(name, index=None)

Set the current object by name, filename or index.

Parameters:
  • name (str) – The name or filename to use when determining the object to select.
  • index (int) – An optional index value to disambiguate duplicate name values.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.setpivot(pos)

Set the pivot point for the current layer. The pivot point is the origin for rotations in Layout.

Parameters:pos (lwsdk.Vector, sequence[3]) – The 3D position of the new pivot point.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.setsurface(surface)

Set the current default surface.

Parameters:surface (str) – The name of the surface.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.shapebevel(pattern)

Perform multiple bevels using a single command.

See also bevel()

Parameters:pattern – A string containing pairs of inset/shift values.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.shear(offset, arg2=None, arg3=None)

Translate points along the defined flex axis.

See also move(), magnet()

Parameters:
  • offset (lwsdk.Vector, sequence[3], float) – The amount to translate, or the ‘X’ distance if a float is provided.
  • arg2 (float) – The ‘Y’ component of the offset if the first parameter is also a float.
  • arg3 (float) – The ‘Z’ component of the offset if the first parameter is also a float.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.skinpols()

Create a triangle mesh that connects two or more polygons and encloses the volume between them (sometimes referred to as “lofting”).

Note that the original polygons are not required to have the same number of vertices.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.smooth(iterations=None, strength=None)

Apply a smoothing function to attempt to remove kinks in polygons connecting affected points.

Parameters:
  • iterations (int) – The number of iterations to perform.
  • strength (float) – The amount of force to exhert when attempting to correct kinks.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.smoothcurves()

Smooth a composite of two curves at their join point.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.smoothscale(offset)

Move and scale part of a mesh.

Vertices are moved as they are with smoothshift(), but no new polygons are created.

See also smoothshift()

Parameters:offset (float) – The amount of offset for the scale.
Returns:int: The result code.
Raises :pris.InitException (if dynavalue cannot be marshalled)
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.smoothshift(offset, maxangle=None, scaling=None)

Extrude part of a mesh in the average (“smoothed”) direction of the shared polygons’ normals.

Parameters:
  • offset (float) – The distance of the shift.
  • maxangle (float) – The optional angle, in degrees, at which mesh will break when exceeded at the edges.
  • scaling (float) – The optional scaling factor to be applied.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.soliddrill(operation, surface=None)

Slice the foreground geometry using a 2D template or 3D shape in the background layer.

See also axisdrill()

Parameters:
  • operation (str) – The operation to perform, one of ‘CORE’, ‘TUNNEL’, ‘SLICE’ or ‘STENCIL’.
  • surface (str) – The optional surface name to apply to the newly created geometry.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.splitpols()

Divide a polygon into two smaller polygons. A new edge is created between selected points.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.subdivide(mode, maxangle=None)

Split triangles into four smaller triangles and quads into four smaller quads.

See also fracsubdivide()

Parameters:
  • mode (str) – The mode of the subdivide, one of ‘FLAT’, ‘SMOOTH’ or ‘METAFORM’.
  • maxangle (float) – The optional maximum angle, in degrees, beyond which normals will not be interpolated.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.swaphidden()

Swaps previously hidden geometry with that currently visible.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.taper(amount, center=None)

Scale points by the given factors around the given center, governed by the defined deformed region.

See also scale(), pole()

Parameters:
  • amount – The amount of the scale effect.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.toggleCCend()

When enabled, the last point in a curve becomes a continuity control point, and can be used to affect the shape of the last segment that is still part of the curve.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.toggleCCstart()

When enabled, the first point in a curve becomes a continuity control point, and can be used to affect the shape of the first segment that is still part of the curve.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.togglepatches()

Toggle the selected geometry into a subpatch control cage.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.triple()

Convert polygons into triangles by subdividing.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.twist(angle, axis, center=None)

Twist points along the given axis by the given angle , in degrees, governed by the defined flex axis.

See also rotate(), vortex()

Parameters:
  • angle (float) – The angle of rotation, in degrees.
  • axis (str) – The axis of the effect, one of ‘X’, ‘Y’ or ‘Z’.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.undo()

Reverts the most recent modification.

See also redo()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.undogroupbegin()

Initiate an undo transaction, allowing for multiple actions to be classified under a single undo operation.

Call this before the first action.

See also undogroupend()

Returns:int: The result code.
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.undogroupend()

Complete an undo transaction, bundling series of actions that are part of a single undo group.

See also undogroupend()

Returns:int: The result code.
Raises :pris.ArgException (if arguments are unacceptable)
lwsdk.pris.modeler.unifypols()

Delete duplicate polygons.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.unweld()

Create multiple copies of the selected points so that none are shared by two polygons at once.

See also weldpoints(), weldaverage()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.vortex(angle, axis, center=None)

Twist points along the given axis by the given angle, in degrees, within the defined deform region.

See also twist(), rotate()

Parameters:
  • angle (float) – The angle of rotation, in degrees.
  • axis (str) – The axis of the effect, one of ‘X’, ‘Y’ or ‘Z’.
  • center (lwsdk.Vector, sequence[3]) – The optional center of the effect.
Returns:

int: The result code.

Raises :

pris.InitException (if dynavalue cannot be marshalled)

Raises :

pris.ArgException (if arguments are unacceptable)

lwsdk.pris.modeler.weldaverage()

Weld selected points into a single point located at the average position of the welded points.

See also unweld(), weldpoints()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.weldpoints()

Merge selected points into a single point.

The position of the resulting point is the same as that of the last-selected point before the weld.

See also unweld(), weldaverage()

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing
lwsdk.pris.modeler.welduv()

Merge selected UV points into a single point.

Returns:int: lwsdk.CSERR_NONE if the function completed successfully, otherwise one of the non-zero error codes.
Raises :Nothing

Table Of Contents

Previous topic

PRIS Common: Common Functionality

This Page