motion

Used for Motion operations.


xshade
shape
motion

List of Methods

add_group Creates a new point group from the currently-selected motion points
copy Copies the currently-selected motion points
create_motion_point Creates a motion point at the specified sequence value
delete_motion_point Deletes a motion point
deselect_all_motion_points Deselects all motion points
get_joint_offset Evaluates and returns the joint offset at the specified frame
get_joint_rotation Evaluates and returns the joint rotation value at the specified frame
get_joint_value Returns the joint value at the specified frame
get_motion_point Returns the motion point of the specified index
get_motion_point_offset Returns ball joint or object camera offset translation
get_motion_point_rotation Returns ball joint rotation or object camera orientation
get_number_of_motion_points Returns the number of motion points
load Loads a motion settings file
paste Pastes the copied motion points relative to the current sequence value
prohibit_update Prohibits Motion Window updates
resume_update Resumes Motion Window updates
save Saves a motion settings file
select_all_motion_points Selects all motion points
select_motion_point Selects a motion point (adds to selection)
set_motion_point_offset Sets ball joint or object camera offset translation
set_motion_point_rotation Sets ball joint rotation or object camera orientation

List of Properties

auto_key Auto Key on/off
current_joint_offset The current joint offset
current_joint_rotation The current joint rotation
current_joint_value The current joint
default_joint_offset The default joint offset
default_joint_rotation The default joint rotation
default_joint_value The joint default
default_max_joint_value The default max joint
default_min_joint_value The default min joint
max_joint_value The max joint
min_joint_value The min joint
repetition The number of repetitions of the motion curve
sequence_mode Sequence Mode on/off




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

Method Details

add_group

Creates a new point group from the currently-selected motion points.
Arguments :
  string : the group name (for backwards compatibility)
Arguments :
  int : the group marker index

0Red
1Orange
2Yellow
3Green
4Blue
5Purple

string is for backwards compatibility and is disabled in Shade 9 and later. It is necessary as an element of the arguments; therefore, specify as "None" or such name.

#Create a new group marked green.
xshade.scene().active_shape().motion.add_group(None, 3)

copy

Copies the currently-selected motion points.

xshade.scene().active_shape().motion.copy()

create_motion_point

Creates a motion point at the specified sequence value.
Return value :
  int : the index number of the created motion point
Arguments :
  float : the sequence value
When a motion point is appended the index number is sorted; therefore, get the index number of the newly-created motion point from the return value.

#Create a motion point at sequence 90
xshade.scene().active_shape().motion.create_motion_point(90)

delete_motion_point

Deletes a motion point.
Arguments :
  int : The index number of the motion point
See also :
  motion_point

#Delete the motion point of index 2
xshade.scene().active_shape().motion.delete_motion_point(2)

deselect_all_motion_points

Deselects all motion points.

xshade.scene().active_shape().motion.deselect_all_motion_points()

get_joint_offset

Evaluates and returns the joint offset at the specified frame.
Return value :
  float3
Arguments :
  float : the sequence value

#Output the offset value at frame 100
print xshade.scene().active_shape().motion.get_joint_offset(100)

get_joint_rotation

Evaluates and returns the joint rotation value at the specified frame.
Return value :
  quaternion
Arguments :
  float : the sequence value

#Output the joint rotation value at frame 150
print xshade.scene().active_shape().motion.get_joint_rotation(150)

get_joint_value

Returns the joint value at the specified frame.
Return value :
  float
Arguments :
  float : the sequence value

#Output the joint value at frame 200
print xshade.scene().active_shape().motion.get_joint_value(200)

get_motion_point

Returns the motion point of the specified index.
Return value :
  motion_point object
Arguments :
  int : The index number of the motion point
The motion points are sorted in order of sequence value.
See also :
  motion_point

#Output the joint value of the index 0 motion point
print xshade.scene().active_shape().motion.get_motion_point(0).value

get_motion_point_offset

Returns ball joint or object camera offset translation.
Return value :
  float3
Arguments :
  int : The index number of the motion point
See also :
  motion_point

#Output the offset value of index 0
print xshade.scene().active_shape().motion.get_motion_point_offset(0)

get_motion_point_rotation

Returns ball joint rotation or object camera orientation.
Return value :
  quaternion
Arguments :
  int : The index number of the motion point
See also :
  motion_point

#Output the orientation at index 0
print xshade.scene().active_shape().motion.get_motion_point_rotation(0)

get_number_of_motion_points

Returns the number of motion points.
Return value :
  int

#Output the number of motion points
print xshade.scene().active_shape().motion.get_number_of_motion_points()

load

Loads a motion settings file.
Arguments :
  file_path
See also :
  save

#Load a motion settings file
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(True, '*.shdmtn|shdmtn')
xshade.scene().active_shape().motion.load(file_path)

paste

Pastes the copied motion points relative to the current sequence value

xshade.scene().active_shape().motion.paste()

prohibit_update

Prohibits Motion Window updates.

xshade.scene().active_shape().motion.prohibit_update()

resume_update

Resumes Motion Window updates.

xshade.scene().active_shape().motion.resume_update()

save

Saves a motion settings file.
Arguments :
  file_path
See also :
  load

#Save a motion settings file
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(False, '*.shdmtn|shdmtn')
xshade.scene().active_shape().motion.save(file_path)

select_all_motion_points

Selects all motion points.

xshade.scene().active_shape().motion.select_all_motion_points()

select_motion_point

Selects a motion point (adds to selection).
Arguments :
  int : The index number of the motion point

#Select index 2
xshade.scene().active_shape().motion.select_motion_point(2)

set_motion_point_offset

Sets ball joint or object camera offset translation.
Arguments :
  int : The index number of the motion point
Arguments :
  float3
See also :
  motion_point

#Set the offset translation of index 2
xshade.scene().active_shape().motion.set_motion_point_offset(2,(100, 0.0, 0.0))

set_motion_point_rotation

Sets ball joint rotation or object camera orientation.
Arguments :
  int : The index number of the motion point
Arguments :
  quaternion
See also :
  motion_point

#Set the orientation of index 2
xshade.scene().active_shape().motion.set_motion_point_rotation(2,(1.0, 0.0, 0.0, 0.0))

Property Details

auto_key

Auto Key on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().motion.auto_key

current_joint_offset

The current joint offset.

  • Get
  • Set

Type :
  float3
Retains the ball joint or object camera offset translation.

print xshade.scene().active_shape().motion.current_joint_offset

current_joint_rotation

The current joint rotation

  • Get
  • Set

Type :
  quaternion
Retains the ball joint rotation or object camera orientation in quaternion.

print xshade.scene().active_shape().motion.current_joint_rotation

current_joint_value

The current joint.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().motion.current_joint_value

default_joint_offset

The default joint offset.

  • Get
  • Set

Type :
  float3
The value used applying "Reset This Joint."

print xshade.scene().active_shape().motion.default_joint_offset

default_joint_rotation

The default joint rotation.

  • Get
  • Set

Type :
  quaternion
The value used applying "Reset This Joint."

print xshade.scene().active_shape().motion.default_joint_rotation

default_joint_value

The joint default.

  • Get
  • Set

Type :
  float
The value used applying "Reset This Joint."

print xshade.scene().active_shape().motion.default_joint_value

default_max_joint_value

The default max joint.

  • Get
  • Set

Type :
  float
Setting this value larger than the default value gives the joint a greater range of movement.

print xshade.scene().active_shape().motion.default_max_joint_value

default_min_joint_value

The default min joint.

  • Get
  • Set

Type :
  float
Setting this value smaller than the default value gives the joint a greater range of movement.

print xshade.scene().active_shape().motion.default_min_joint_value

max_joint_value

The max joint.

  • Get
  • Set

Type :
  float
The limiter position of the joint slider changes.

print xshade.scene().active_shape().motion.max_joint_value

min_joint_value

The min joint.

  • Get
  • Set

Type :
  float
The limiter position of the joint slider changes.

print xshade.scene().active_shape().motion.min_joint_value

repetition

The number of repetitions of the motion curve.

  • Get
  • Set

Type :
  int
In Shade 7 and earlier, this is the number of repetitions of the whole animation.
This does not affect the Motion Window "Repeat" number in Shade 10.

print xshade.scene().active_shape().motion.repetition

sequence_mode

Sequence Mode on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().motion.sequence_mode