Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
EggTopstrip Class Reference

Reads a character model and/or animations and strips out the animation from one of the top joints from the entire character. More...

#include "eggTopstrip.h"

Inheritance diagram for EggTopstrip:
EggCharacterFilter EggMultiFilter EggMultiBase EggBase ProgramBase

Public Member Functions

void adjust_transform (LMatrix4d &mat) const
 Adjust the transform extracted from the "top" joint according to the -s and -i/-n options, prior to applying it to the skeleton.
 
void check_transform_channels ()
 Checks the _transform_channels string to ensure that it contains only the expected nine letters, or a subset.
 
void run ()
 
void strip_anim (EggCharacterData *char_data, EggJointData *joint_data, int from_model, EggCharacterData *from_char, EggJointData *top_joint, EggCharacterDb &db)
 Applies the channels from joint _top_joint in model from_model to the joint referenced by joint_data.
 
void strip_anim_vertices (EggNode *egg_node, int into_model, int from_model, EggJointData *top_joint, EggCharacterDb &db)
 Applies the channels from joint _top_joint in model from_model to the vertices at egg_node.
 
- Public Member Functions inherited from EggCharacterFilter
void add_fixrest_option ()
 
- Public Member Functions inherited from EggMultiFilter
 EggMultiFilter (bool allow_empty=false)
 
- Public Member Functions inherited from EggMultiBase
void post_process_egg_files ()
 Performs any processing of the egg file(s) that is appropriate before writing them out.
 
- Public Member Functions inherited from EggBase
void add_normals_options ()
 Adds -no, -np, etc.
 
void add_points_options ()
 Adds -points as a valid option for this program.
 
void add_transform_options ()
 Adds -TS, -TT, etc.
 
- Public Member Functions inherited from ProgramBase
 ProgramBase (const std::string &name=std::string())
 
std::string get_exec_command () const
 Returns the command that invoked this program, as a shell-friendly string, suitable for pasting into the comments of output files.
 
virtual void parse_command_line (int argc, char **argv)
 Dispatches on each of the options on the command line, and passes the remaining parameters to handle_args().
 
void show_description ()
 Writes the program description to stderr.
 
void show_options ()
 Describes each of the available options to stderr.
 
void show_text (const std::string &prefix, int indent_width, std::string text)
 Formats the indicated text and its prefix for output to stderr with the known _terminal_width.
 
void show_text (const std::string &text)
 Formats the indicated text to stderr with the known _terminal_width.
 
void show_usage ()
 Writes the usage line(s) to stderr.
 
void write_man_page (std::ostream &out)
 Generates a man page in nroff syntax based on the description and options.
 

Public Attributes

Filename _channel_filename
 
bool _got_invert_transform
 
bool _invert_transform
 
std::string _top_joint_name
 
std::string _transform_channels
 
- Public Attributes inherited from ProgramBase
Args _program_args
 
Filename _program_name
 

Additional Inherited Members

- Public Types inherited from ProgramBase
typedef pdeque< std::string > Args
 
- Static Public Member Functions inherited from EggBase
static void convert_paths (EggNode *node, PathReplace *path_replace, const DSearchPath &additional_path)
 Recursively walks the egg hierarchy.
 

Detailed Description

Reads a character model and/or animations and strips out the animation from one of the top joints from the entire character.

Particularly useful for generating stackable character models from separately-extracted characters.

Definition at line 34 of file eggTopstrip.h.

Constructor & Destructor Documentation

◆ EggTopstrip()

EggTopstrip::EggTopstrip ( )

Definition at line 28 of file eggTopstrip.cxx.

Member Function Documentation

◆ adjust_transform()

void EggTopstrip::adjust_transform ( LMatrix4d & mat) const

Adjust the transform extracted from the "top" joint according to the -s and -i/-n options, prior to applying it to the skeleton.

Definition at line 286 of file eggTopstrip.cxx.

Referenced by strip_anim(), and strip_anim_vertices().

◆ check_transform_channels()

void EggTopstrip::check_transform_channels ( )

Checks the _transform_channels string to ensure that it contains only the expected nine letters, or a subset.

Definition at line 186 of file eggTopstrip.cxx.

◆ run()

void EggTopstrip::run ( )

Definition at line 82 of file eggTopstrip.cxx.

◆ strip_anim()

void EggTopstrip::strip_anim ( EggCharacterData * char_data,
EggJointData * joint_data,
int from_model,
EggCharacterData * from_char,
EggJointData * top_joint,
EggCharacterDb & db )

Applies the channels from joint _top_joint in model from_model to the joint referenced by joint_data.

Definition at line 221 of file eggTopstrip.cxx.

References adjust_transform(), EggJointData::get_frame(), EggComponentData::get_model(), EggJointData::get_net_frame(), EggCharacterData::get_num_frames(), EggComponentData::get_num_models(), EggComponentData::has_model(), and EggCharacterDb::set_matrix().

◆ strip_anim_vertices()

void EggTopstrip::strip_anim_vertices ( EggNode * egg_node,
int into_model,
int from_model,
EggJointData * top_joint,
EggCharacterDb & db )

Applies the channels from joint _top_joint in model from_model to the vertices at egg_node.

Definition at line 265 of file eggTopstrip.cxx.

References adjust_transform(), EggJointData::get_net_frame(), EggComponentData::has_model(), and EggNode::transform_vertices_only().

Member Data Documentation

◆ _channel_filename

Filename EggTopstrip::_channel_filename

Definition at line 55 of file eggTopstrip.h.

◆ _got_invert_transform

bool EggTopstrip::_got_invert_transform

Definition at line 52 of file eggTopstrip.h.

◆ _invert_transform

bool EggTopstrip::_invert_transform

Definition at line 53 of file eggTopstrip.h.

◆ _top_joint_name

std::string EggTopstrip::_top_joint_name

Definition at line 51 of file eggTopstrip.h.

◆ _transform_channels

std::string EggTopstrip::_transform_channels

Definition at line 54 of file eggTopstrip.h.


The documentation for this class was generated from the following files: