Jelajahi Sumber

add copy_egg rule

David Rose 20 tahun lalu
induk
melakukan
3fdb03efbd
2 mengubah file dengan 32 tambahan dan 0 penghapusan
  1. 10 0
      dtool/pptempl/Template.models.pp
  2. 22 0
      panda/src/doc/ppremake-models.txt

+ 10 - 0
dtool/pptempl/Template.models.pp

@@ -349,6 +349,16 @@ $[TAB]$[SOFT2EGG] $[SOFT2EGG_OPTS] $[if $[SOFTIMAGE_RSRC],-r "$[osfilename $[SOF
   #end anim
   #end anim
 #end soft_char_egg
 #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.
 // Generic egg filters.
 #forscopes filter_egg
 #forscopes filter_egg

+ 22 - 0
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
     #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
 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
   files, one at a time.  This is usually done when an egg file
   generated by one of the above steps needs additional processing.
   generated by one of the above steps needs additional processing.