part

Used for part operations.


xshade
shape
part

List of Methods

clean_surface_part_polygonmesh Deletes polygon mesh information from a curved surface
disclose_all Displays all contents of the selected part, including child parts
get_plane_equation Returns the plane equation
realize_link Substantializes a link
realize_replicator Substantializes a replicator
reverse Applies Reverse
select_camera_joint Sets a camera object to the currently active camera
set_view Makes the selected camera object the active camera
setup_plane_equation Sets up the plane equation
setup_surface_part_polygonmesh Sets polygon mesh information to a curved surface
switch Applies Switch
undisclose_all Hides all contents of the selected part, including child parts

List of Properties

closed Whether or not all the line objects in the part are closed line objects
disclosed Whether or not the part's contents are displayed in the Browser
edge Returns the edge object of the specified edge
face Returns the face object of the specified face
flat_joint Flat
group Group Selection on/off
is_master_image Whether or not it is a master image part
is_master_shape Whether or not it is a master object part
is_master_surface Whether or not it is a master surface part
is_pose_joint Whether or not it is a pose joint
joint_blend Joint blend
joint_matrix The joint transformation matrix
link_master The link's original object
number_of_active_control_points The number of selected control points
number_of_edges The number of edges
number_of_faces The number of faces
number_of_sons The number of objects one level below in the hierarchy
number_of_vertices The number of vertices
part_type The part type
surface_closed Whether or not the curved surface lateral is closed
surface_switched Whether or not the curved surface is switched vertically and horizontally
transformation_matrix The object's transformation matrix
vertex Returns the vertex object of the specified vertex
view_anchor Object Camera Translation Mode in the Motion Window




Used after getting an object with a method such as xshade.scene().active_shape().

Method Details

clean_surface_part_polygonmesh

Deletes polygon mesh information from a curved surface.
See also :
  setup_surface_part_polygonmesh

xshade.scene().active_shape().clean_surface_part_polygonmesh()

disclose_all

Displays all contents of the selected part, including child parts.
See also :
  undisclose_all

xshade.scene().active_shape().disclose_all()

get_plane_equation

Returns the plane equation.
Return value :
  float4
Arguments :
  int : the face number
See also :
  setup_plane_equation
  setup_surface_part_polygonmesh
Return the plane equation set with setup_plane_equationfor curved surfaces set with polygon mesh information via setup_surface_part_polygonmesh().

xshade.scene().active_shape().set_plane_equation()
print xshade.scene().active_shape().get_plane_equation(0)

realize_link

Substantializes a link.
Return value :
  shape
See also :
  shape

#If the selected object is a link, substantialize it
xshade.scene().active_shape().realize_link()

realize_replicator

Substantializes a replicator.
Return value :
  shape
See also :
  shape

#If the selected object is a replicator, substantialize it
xshade.scene().active_shape().realize_replicator()

reverse

Applies Reverse.

xshade.scene().active_shape().reverse()

select_camera_joint

Sets a camera object to the currently active camera.
Only valid for camera objects.

#Make the selected camera object the active camera
camera_obj = xshade.scene().active_shape()
camera_obj. select_camera_joint()

set_view

Makes the selected camera object the active camera.

xshade.scene().active_shape().set_view()

setup_plane_equation

Sets up the plane equation.
See also :
  get_plane_equation
  setup_surface_part_polygonmesh
Use setup_surface_part_polygonmesh() to set curved surfaces with polygon mesh information.

xshade.scene().active_shape().setup_surface_part_polygonmesh()
xshade.scene().active_shape().setup_plane_equation()

setup_surface_part_polygonmesh

Sets polygon mesh information to a curved surface.
Arguments :
  int : Subdivision of the polygon mesh : 0: No subdivision, 1: Coarse, 2: Regular, 3: Fine, 4: Very fine
  If omitted, "2: Regular" is used.
The following information can be gotten and set for curved surfaces:

get_plane_equationReturns the plane equation
setup_plane_equationSets up the plane equation
edgeReturns the edge object of the specified edge
face Returns the face object of the specified face
number_of_edgesThe number of edges
number_of_facesThe number of faces
number_of_verticesThe number of vertices
vertexThe vertex object of the specified vertex
#Set polygon mesh information to a curved surface and output that information
#If an error occurs, output the error
try:
	s = xshade.scene().active_shape()
	assert s.type == 2 and s.part_type == 1, 'Select a curved surface.'
	if s.type == 2 and s.part_type == 1:
		s.setup_surface_part_polygonmesh()
		s.setup_plane_equation()
		print 'The plane equation of face 0:',s.get_plane_equation(0)
		print 'The coordinates of vertex 0:',s.vertex(0).position
		print 'The distance UV coordinates of face 0:',s.face(0).distance_uv
		print 'The parameter UV coordinates of face 0:',s.face(0).parameter_uv
		print 'Number of edges:',s.number_of_edges
		print 'The number of faces:',s.number_of_faces
		print 'The number of vertices:',s.number_of_vertices
		s.setup_normal()
		print 'The normal of vertex 0:',s.vertex(0).normal
		s.clean_surface_part_polygonmesh()
except AssertionError, message:
	print message

switch

Applies Switch.
Because a line object will be regenerated when Switch is applied, the shape class pointer of the line object in the part will also change.

xshade.scene().active_shape().switch()

undisclose_all

Hides all contents of the selected part, including child parts.
See also :
  disclose_all

xshade.scene().active_shape().undisclose_all()

Property Details

closed

Whether or not all the line objects in the part are closed line objects.

Type :
  bool

print xshade.scene().active_shape().closed

disclosed

Whether or not the part's contents are displayed in the Browser.

Type :
  bool

print xshade.scene().active_shape().disclosed

edge

Returns the edge object of the specified edge.

Return value :
  edge object
Arguments :
  int : the edge number
See also :
  edge
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

#Output both vertices of the edge object of edge 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).v0
print xshade.scene().active_shape().edge(0).v1

face

Returns the face object of the specified face.

Return value :
  face object
Arguments :
  int : the face number
See also :
  face
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

#Output list of distance UV coordinates of the face object of face 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).face(0).distance_uv

flat_joint

Flat.

Type :
  bool : True : Flat, False : Hierarchical

print xshade.scene().active_shape().flat_joint

group

Group Selection on/off.

Type :
  bool

print xshade.scene().active_shape().group

is_master_image

Whether or not it is a master image part.

Type :
  bool

print xshade.scene().active_shape().is_master_image

is_master_shape

Whether or not it is a master object part.

Type :
  bool

print xshade.scene().active_shape().is_master_shape

is_master_surface

Whether or not it is a master surface part.

Type :
  bool

print xshade.scene().active_shape().is_master_surface

is_pose_joint

Whether or not it is a pose joint.

Type :
  bool
Determines whether the special character "|" is included in the part object name.

print xshade.scene().active_shape().is_pose_joint

joint_blend

Joint blend.

Type :
  float

print xshade.scene().active_shape().joint_blend

joint_matrix

The joint transformation matrix.

Type :
  mat4

print xshade.scene().active_shape().joint_matrix

link_master

The link's original object.

Type :
  shape object
Only valid for link objects.

#Output the name of the link's original object
print xshade.scene().active_shape().link_master.name

number_of_active_control_points

The number of selected control points.

Type :
  int

print xshade.scene().active_shape().number_of_active_control_points

number_of_edges

The number of edges.

Type :
  int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().number_of_edges

number_of_faces

The number of faces.

Type :
  int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().number_of_faces

number_of_sons

The number of objects one level below in the hierarchy.

Type :
  int

print xshade.scene().active_shape().number_of_sons

number_of_vertices

The number of vertices.

Type :
  int
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().number_of_vertices

part_type

The part type.

Type :
  int

0partsimple_part
1curved surfacesurface_part
2rotator jointrotator_joint
3slider jointslider_joint
4scale jointscale_joint
5uniscale jointuniscale_joint
6light jointlight_joint
7path jointpath_joint
8morph jointmorph_joint
9custom jointcustom_joint
10ball jointball_joint
11cameracamera_joint
12soundsound_part
13switchswitch_joint
14path replicatorpath_replicator
15surface replicatorsurface_replicator
16bone jointbone_joint
100master surfacemaster_surface_part
101linklink_part
102master imagemaster_image_part
103master objectmaster_shape_part
104master object (external reference object)master_shape_object_part
105local axislocal_axis_part

The following properties can determine if it is a specific type of part:

part 
curved surface 
rotator jointshape.is_rotator_joint
slider jointshape.is_slider_joint
scale jointshape.is_scale_joint
uniscale jointshape.is_uniscale_joint
light jointshape.is_light_effector
path jointshape.is_path_joint
morph jointshape.is_morph_effector
custom jointshape.is_custom_joint
ball jointshape.is_ball_joint
camera 
soundshape.is_sound_track
switchshape.is_switch_effector
path replicator 
surface replicator 
bone jointshape.is_bone_joint
master surfaceshape.is_master_surface
link 
master imageshape.is_master_image
master objectshape.is_master_shape
master object (external reference object) 
local axis 
print xshade.scene().active_shape().part_type

surface_closed

Whether or not the curved surface lateral is closed.

Type :
  bool

print xshade.scene().active_shape().surface_closed

surface_switched

Whether or not the curved surface is switched vertically and horizontally.

Type :
  bool
To actually switch the curved surface use switch().
By setting the 'not' value so that if True, False, and if False, True, the switch flag can be reversed without actually switching the curved surface.
Because a line object will be regenerated when Switch is applied, the shape class pointer of the line object in the part will also change.

print xshade.scene().active_shape().surface_switched

transformation_matrix

The object's transformation matrix.

Type :
  mat4
Does not take joints or skin into account; simply the matrix values assigned to the object.

print xshade.scene().active_shape().transformation_matrix

vertex

Returns the vertex object of the specified vertex.

Return value :
  vertex object
Arguments :
  int : the vertex number
See also :
  vertex
Used for curved surfaces with polygon mesh information set via setup_surface_part_polygonmesh().

#Output vertex object coordinates of vertex 0
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).vertex(0).position

view_anchor

Object Camera Translation Mode in the Motion Window.

Type :
  int :

0Eye point and target point
1Eye point
2Target point
print xshade.scene().active_shape().view_anchor