diff --git a/dtool/pptempl/Template.models.pp b/dtool/pptempl/Template.models.pp index 3ac781efae..3ceefc4261 100644 --- a/dtool/pptempl/Template.models.pp +++ b/dtool/pptempl/Template.models.pp @@ -349,6 +349,16 @@ $[TAB]$[SOFT2EGG] $[SOFT2EGG_OPTS] $[if $[SOFTIMAGE_RSRC],-r "$[osfilename $[SOF #end anim #end soft_char_egg +// Copying egg files from A to B. +#forscopes copy_egg + #for i 1,$[words $[SOURCES]] + #define source $[word $[i],$[SOURCES]] + #define target $[word $[i],$[TARGETS]] +$[target] : $[source] +$[TAB]cp $[source] $[target] + #end i +#end copy_egg + // Generic egg filters. #forscopes filter_egg diff --git a/panda/src/doc/ppremake-models.txt b/panda/src/doc/ppremake-models.txt index df465a2bca..eb8ed34bde 100644 --- a/panda/src/doc/ppremake-models.txt +++ b/panda/src/doc/ppremake-models.txt @@ -355,6 +355,28 @@ optchar_egg - Runs egg-optchar on a character model (and/or multiple #end optchar_egg +copy_egg - Copies an egg file, or a list of egg files, to another file + with a different name. This is particularly useful when extracting + one file for multiple purposes, for instance before using + egg-retarget-anim to retarget an animation to multiple skeletons. + + SOURCES - The list of original egg file names. + + TARGETS - The list of target egg file names. There should be the + same number of filenames in TARGETS as in SOURCES, and they will + be matched up one-to-one; that is, the first egg file in SOURCES + will be copied to the first filename in TARGET, the second egg + file in SOURCES will be copied to the second filename in TARGET, + and so on. + + Example: + + #begin copy_egg + #define SOURCES elf-walk.egg elf-run.egg + #define TARGETS dwarf-walk.egg dwarf-run.egg + #end copy_egg + + filter_egg - Runs an arbitrary egg command on one or more named egg files, one at a time. This is usually done when an egg file generated by one of the above steps needs additional processing.