eggSyntax.txt 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954
  1. THE PHILOSOPHY OF EGG FILES (vs. bam files)
  2. Egg files are used by Panda3D to describe many properties of a scene:
  3. simple geometry, including special effects and collision surfaces,
  4. characters including skeletons, morphs, and multiple-joint
  5. assignments, and character animation tables.
  6. Egg files are designed to be the lingua franca of model manipulation
  7. for Panda tools. A number of utilities are provided that read and
  8. write egg files, for instance to convert to or from some other
  9. modeling format, or to apply a transform or optimize vertices. The
  10. egg file philosophy is to describe objects in an abstract way that
  11. facilitates easy manipulation; thus, the format doesn't (usually)
  12. include information such as polygon connectivity or triangle meshes.
  13. Egg files are furthermore designed to be human-readable to help a
  14. developer diagnose (and sometimes repair) problems. Also, the egg
  15. syntax is always intended to be backward compatible with previous
  16. versions, so that as the egg syntax is extended, old egg files will
  17. continue to remain valid.
  18. This is a different philosophy than Panda's bam file format, which is
  19. a binary representation of a model and/or animation that is designed
  20. to be loaded quickly and efficiently, and is strictly tied to a
  21. particular version of Panda. The data in a bam file closely mirrors
  22. the actual Panda structures that are used for rendering. Although an
  23. effort is made to keep bam files backward compatible, occasionally
  24. this is not possible and we must introduce a new bam file major
  25. version.
  26. Where egg files are used for model conversion and manipulation of
  27. models, bam files are strictly used for loading models into Panda.
  28. Although you can load an egg file directly, a bam file will be loaded
  29. much more quickly.
  30. Egg files might be generated by outside sources, and thus it makes
  31. sense to document its syntax here. Bam files, on the other hand,
  32. should only be generated by Panda3D, usually by the program egg2bam.
  33. The exact specification of the bam file format, if you should need it,
  34. is documented within the Panda3D code itself.
  35. GENERAL EGG SYNTAX
  36. Egg files consist of a series of sequential and hierarchically-nested
  37. entries. In general, the syntax of each entry is:
  38. <Entry-type> name { contents }
  39. Where the name is optional (and in many cases, ignored anyway) and the
  40. syntax of the contents is determined by the entry-type. The name (and
  41. strings in general) may be either quoted with double quotes or
  42. unquoted. Newlines are treated like any other whitespace, and case is
  43. not significant. The angle brackets are literally a part of the entry
  44. keyword. (Square brackets and ellipses in this document are used to
  45. indicate optional pieces, and are not literally part of the syntax.)
  46. The name field is always syntactically allowed between an entry
  47. keyword and its opening brace, even if it will be ignored. In the
  48. syntax lines given below, the name is not shown if it will be ignored.
  49. Comments may be delimited using either the C++-style // ... or the
  50. C-style /* ... */. C comments do not nest. There is also a <Comment>
  51. entry type, of the form:
  52. <Comment> { text }
  53. <Comment> entries are slightly different, in that tools which read and
  54. write egg files will preserve the text within <Comment> entries, but
  55. they may not preserve comments delimited by // or /* */. Special
  56. characters and keywords within a <Comment> entry should be quoted;
  57. it's safest to quote the entire comment.
  58. LOCAL INFORMATION ENTRIES
  59. These nodes contain information relevant to the current level of
  60. nesting only.
  61. <Scalar> name { value }
  62. <Char*> name { value }
  63. Scalars can appear in various contexts. They are always optional,
  64. and specify some attribute value relevant to the current context.
  65. The scalar name is the name of the attribute; different attribute
  66. names are meaningful in different contexts. The value is either a
  67. numeric or a (quoted or unquoted) string value; the interpretation
  68. as a number or as a string depends on the nature of the named
  69. attribute. Because of a syntactic accident with the way the egg
  70. syntax evolved, <Scalar> and <Char*> are lexically the same and both
  71. can represent either a string or a number. <Char*> is being phased
  72. out; it is suggested that new egg files use only <Scalar>.
  73. GLOBAL INFORMATION ENTRIES
  74. These nodes contain information relevant to the file as a whole. They
  75. can be nested along with geometry nodes, but this nesting is
  76. irrelevant and the only significant placement rule is that they should
  77. appear before they are referenced.
  78. <CoordinateSystem> { string }
  79. This entry indicates the coordinate system used in the egg file; the
  80. egg loader will automatically make a conversion if necessary. The
  81. following strings are valid: Y-up, Z-up, Y-up-right, Z-up-right,
  82. Y-up-left, or Z-up-left. (Y-up is the same as Y-up-right, and Z-up
  83. is the same as Z-up-right.)
  84. By convention, this entry should only appear at the beginning of the
  85. file, although it is technically allowed anywhere. It is an error
  86. to include more than one coordinate system entry in the same file.
  87. If it is omitted, Y-up is assumed.
  88. <Texture> name { filename [scalars] }
  89. This describes a texture file that can be referenced later with
  90. <TRef> { name }. It is not necessary to make a <Texture> entry for
  91. each texture to be used; a texture may also be referenced directly
  92. by the geometry via an abbreviated inline <Texture> entry, but a
  93. separate <Texture> entry is the only way to specify anything other
  94. than the default texture attributes.
  95. If the filename is a relative path, the current egg file's directory
  96. is searched first, and then the texture-path and model-path are
  97. searched.
  98. The following attributes are presently implemented for textures:
  99. <Scalar> alpha-file { alpha-filename }
  100. If this scalar is present, the texture file's alpha channel is
  101. read in from the named image file (which should contain a
  102. grayscale image), and the two images are combined into a single
  103. two- or four-channel image internally. This is useful for loading
  104. alpha channels along with image file formats like JPEG that don't
  105. traditionally support alpha channels.
  106. <Scalar> alpha-file-channel { channel }
  107. This defines the channel that should be extracted from the file
  108. named by alpha-file to determine the alpha channel for the
  109. resulting channel. The default is 0, which means the grayscale
  110. combination of r, g, b. Otherwise, this should be the 1-based
  111. channel number, for instance 1, 2, or 3 for r, g, or b,
  112. respectively, or 4 for the alpha channel of a four-component
  113. image.
  114. <Scalar> format { format-definition }
  115. This defines the load format of the image file. The
  116. format-definition is one of:
  117. RGBA, RGBM, RGBA12, RGBA8, RGBA4,
  118. RGB, RGB12, RGB8, RGB5, RGB332,
  119. LUMINANCE_ALPHA,
  120. RED, GREEN, BLUE, ALPHA, LUMINANCE
  121. The formats whose names end in digits specifically request a
  122. particular texel width. RGB12 and RGBA12 specify 48-bit texels
  123. with or without alpha; RGB8 and RGBA8 specify 32-bit texels, and
  124. RGB5 and RGBA4 specify 16-bit texels. RGB332 specifies 8-bit
  125. texels.
  126. The remaining formats are generic and specify only the semantic
  127. meaning of the channels. The size of the texels is determined by
  128. the width of the components in the image file. RGBA is the most
  129. general; RGB is the same, but without any alpha channel. RGBM is
  130. like RGBA, except that it requests only one bit of alpha, if the
  131. graphics card can provide that, to leave more room for the RGB
  132. components, which is especially important for older 16-bit
  133. graphics cards (the "M" stands for "mask", as in a cutout).
  134. The number of components of the image file should match the format
  135. specified; if it does not, the egg loader will attempt to provide
  136. the closest match that does.
  137. <Scalar> compression { compression-mode }
  138. Defines an explicit control over the real-time compression mode
  139. applied to the texture. The various options are:
  140. DEFAULT OFF ON
  141. FXT1 DXT1 DXT2 DXT3 DXT4 DXT5
  142. This controls the compression of the texture when it is loaded
  143. into graphics memory, and has nothing to do with on-disk
  144. compression such as JPEG. If this option is omitted or "DEFAULT",
  145. then the texture compression is controlled by the
  146. compressed-textures config variable. If it is "OFF", texture
  147. compression is explicitly off for this texture regardless of the
  148. setting of the config variable; if it is "ON", texture compression
  149. is explicitly on, and a default compression algorithm supported by
  150. the driver is selected. If any of the other options, it names the
  151. specific compression algorithm to be used.
  152. <Scalar> wrap { repeat-definition }
  153. <Scalar> wrapu { repeat-definition }
  154. <Scalar> wrapv { repeat-definition }
  155. <Scalar> wrapw { repeat-definition }
  156. This defines the behavior of the texture image outside of the
  157. normal (u,v) range 0.0 - 1.0. It is "REPEAT" to repeat the
  158. texture to infinity, "CLAMP" not to. The wrapping behavior may be
  159. specified independently for each axis via "wrapu" and "wrapv", or
  160. it may be specified for both simultaneously via "wrap".
  161. Although less often used, for 3-d textures wrapw may also be
  162. specified, and it behaves similarly to wrapu and wrapv.
  163. There are other legal values in addtional to REPEAT and CLAMP.
  164. The full list is:
  165. CLAMP
  166. REPEAT
  167. MIRROR
  168. MIRROR_ONCE
  169. BORDER_COLOR
  170. <Scalar> borderr { red-value }
  171. <Scalar> borderg { green-value }
  172. <Scalar> borderb { blue-value }
  173. <Scalar> bordera { alpha-value }
  174. These define the "border color" of the texture, which is
  175. particularly important when one of the wrap modes, above, is
  176. BORDER_COLOR.
  177. <Scalar> type { texture-type }
  178. This may be one of the following attributes:
  179. 1D
  180. 2D
  181. 3D
  182. CUBE_MAP
  183. The default is "2D", which specifies a normal, 2-d texture. If
  184. any of the other types is specified instead, a texture image of
  185. the corresponding type is loaded.
  186. If 3D or CUBE_MAP is specified, then a series of texture images
  187. must be loaded to make up the complete texture; in this case, the
  188. texture filename is expected to include a sequence of one or more
  189. hash mark ("#") characters, which will be filled in with the
  190. sequence number. The first image in the sequence must be numbered
  191. 0, and there must be no gaps in the sequence. In this case, a
  192. separate alpha-file designation is ignored; the alpha channel, if
  193. present, must be included in the same image with the color
  194. channel(s).
  195. <Scalar> read-mipmaps { flag }
  196. If this flag is nonzero, then pre-generated mipmap levels will be
  197. loaded along with the texture. In this case, the filename should
  198. contain a sequence of one or more hash mark ("#") characters,
  199. which will be filled in with the mipmap level number; the texture
  200. filename thus determines a series of images, one for each mipmap
  201. level. The base texture image is mipmap level 0.
  202. If this flag is specified in conjunction with a 3D or cube map
  203. texture (as specified above), then the filename should contain two
  204. hash mark sequences, separated by a character such as an
  205. underscore, hyphen, or dot. The first sequence will be filled in
  206. with the mipmap level index, and the second sequence will be
  207. filled in with the 3D sequence or cube map face.
  208. <Scalar> minfilter { filter-type }
  209. <Scalar> magfilter { filter-type }
  210. <Scalar> magfilteralpha { filter-type }
  211. <Scalar> magfiltercolor { filter-type }
  212. This specifies the type of filter applied when minimizing or
  213. maximizing. Filter-type may be one of:
  214. NEAREST
  215. LINEAR
  216. NEAREST_MIPMAP_NEAREST
  217. LINEAR_MIPMAP_NEAREST
  218. NEAREST_MIPMAP_LINEAR
  219. LINEAR_MIPMAP_LINEAR
  220. There are also some additional filter types that are supported for
  221. historical reasons, but each of those additional types maps to one
  222. of the above. New egg files should use only the above filter
  223. types.
  224. <Scalar> envtype { environment-type }
  225. This specifies the type of texture environment to create; i.e. it
  226. controls the way in which textures apply to models.
  227. Environment-type may be one of:
  228. MODULATE
  229. DECAL
  230. BLEND
  231. REPLACE
  232. ADD
  233. BLEND_COLOR_SCALE
  234. MODULATE_GLOW
  235. MODULATE_GLOSS
  236. *NORMAL
  237. *NORMAL_HEIGHT
  238. *GLOW
  239. *GLOSS
  240. *HEIGHT
  241. *SELECTOR
  242. The default environment type is MODULATE, which means the texture
  243. color is multiplied with the base polygon (or vertex) color. This
  244. is the most common texture environment by far. Other environment
  245. types are more esoteric and are especially useful in the presence
  246. of multitexture. In particular, the types prefixed by an asterisk
  247. (*) require enabling Panda's automatic ShaderGenerator.
  248. <Scalar> combine-rgb { combine-mode }
  249. <Scalar> combine-alpha { combine-mode }
  250. <Scalar> combine-rgb-source0 { combine-source }
  251. <Scalar> combine-rgb-operand0 { combine-operand }
  252. <Scalar> combine-rgb-source1 { combine-source }
  253. <Scalar> combine-rgb-operand1 { combine-operand }
  254. <Scalar> combine-rgb-source2 { combine-source }
  255. <Scalar> combine-rgb-operand2 { combine-operand }
  256. <Scalar> combine-alpha-source0 { combine-source }
  257. <Scalar> combine-alpha-operand0 { combine-operand }
  258. <Scalar> combine-alpha-source1 { combine-source }
  259. <Scalar> combine-alpha-operand1 { combine-operand }
  260. <Scalar> combine-alpha-source2 { combine-source }
  261. <Scalar> combine-alpha-operand2 { combine-operand }
  262. These options replace the envtype and specify the texture combiner
  263. mode, which is usually used for multitexturing. This specifies
  264. how the texture combines with the base color and/or the other
  265. textures applied previously. You must specify both an rgb and an
  266. alpha combine mode. Some combine-modes use one source/operand
  267. pair, and some use all three; most use just two.
  268. combine-mode may be one of:
  269. REPLACE
  270. MODULATE
  271. ADD
  272. ADD-SIGNED
  273. INTERPOLATE
  274. SUBTRACT
  275. DOT3-RGB
  276. DOT3-RGBA
  277. combine-source may be one of:
  278. TEXTURE
  279. CONSTANT
  280. PRIMARY-COLOR
  281. PREVIOUS
  282. CONSTANT_COLOR_SCALE
  283. LAST_SAVED_RESULT
  284. combine-operand may be one of:
  285. SRC-COLOR
  286. ONE-MINUS-SRC-COLOR
  287. SRC-ALPHA
  288. ONE-MINUS-SRC-ALPHA
  289. The default values if any of these are omitted are:
  290. <Scalar> combine-rgb { modulate }
  291. <Scalar> combine-alpha { modulate }
  292. <Scalar> combine-rgb-source0 { previous }
  293. <Scalar> combine-rgb-operand0 { src-color }
  294. <Scalar> combine-rgb-source1 { texture }
  295. <Scalar> combine-rgb-operand1 { src-color }
  296. <Scalar> combine-rgb-source2 { constant }
  297. <Scalar> combine-rgb-operand2 { src-alpha }
  298. <Scalar> combine-alpha-source0 { previous }
  299. <Scalar> combine-alpha-operand0 { src-alpha }
  300. <Scalar> combine-alpha-source1 { texture }
  301. <Scalar> combine-alpha-operand1 { src-alpha }
  302. <Scalar> combine-alpha-source2 { constant }
  303. <Scalar> combine-alpha-operand2 { src-alpha }
  304. <Scalar> saved-result { flag }
  305. If flag is nonzero, then it indicates that this particular texture
  306. stage will be supplied as the "last_saved_result" source for any
  307. future texture stages.
  308. <Scalar> tex-gen { mode }
  309. This specifies that texture coordinates for the primitives that
  310. reference this texture should be dynamically computed at runtime,
  311. for instance to apply a reflection map or some other effect. The
  312. valid values for mode are:
  313. EYE_SPHERE_MAP (or SPHERE_MAP)
  314. WORLD_CUBE_MAP
  315. EYE_CUBE_MAP (or CUBE_MAP)
  316. WORLD_NORMAL
  317. EYE_NORMAL
  318. WORLD_POSITION
  319. EYE_POSITION
  320. POINT_SPRITE
  321. <Scalar> stage-name { name }
  322. Specifies the name of the TextureStage object that is created to
  323. render this texture. If this is omitted, a custom TextureStage is
  324. created for this texture if it is required (e.g. because some
  325. other multitexturing parameter has been specified), or the system
  326. default TextureStage is used if multitexturing is not required.
  327. <Scalar> priority { priority-value }
  328. Specifies an integer sort value to rank this texture in priority
  329. among other textures that are applied to the same geometry. This
  330. is only used to eliminate low-priority textures in case more
  331. textures are requested for a particular piece of geometry than the
  332. graphics hardware can render.
  333. <Scalar> blendr { red-value }
  334. <Scalar> blendg { green-value }
  335. <Scalar> blendb { blue-value }
  336. <Scalar> blenda { alpha-value }
  337. Specifies a four-component color that is applied with the color in
  338. case the envtype, above, is "blend", or one of the combine-sources
  339. is "constant".
  340. <Scalar> uv-name { name }
  341. Specifies the name of the texture coordinates that are to be
  342. associated with this texture. If this is omitted, the default
  343. texture coordinates are used.
  344. <Scalar> rgb-scale { scale }
  345. <Scalar> alpha-scale { scale }
  346. Specifies an additional scale factor that will scale the r, g, b
  347. (or a) components after the texture has been applied. This is
  348. only used when a combine mode is in effect. The only legal values
  349. are 1, 2, or 4.
  350. <Scalar> alpha { alpha-type }
  351. This specifies whether and what type of transparency will be
  352. performed. Alpha-type may be one of:
  353. OFF
  354. ON
  355. BLEND
  356. BLEND_NO_OCCLUDE
  357. MS
  358. MS_MASK
  359. If alpha-type is OFF, it means not to enable transparency, even if
  360. the image contains an alpha channel or the format is RGBA. If
  361. alpha-type is ON, it means to enable the default transparency,
  362. even if the image filename does not contain an alpha channel. If
  363. alpha-type is any of the other options, it specifies the type of
  364. transparency to be enabled.
  365. <Scalar> bin { bin-name }
  366. This specifies the bin name order of all polygons with this
  367. texture applied, in the absence of a bin name specified on the
  368. polygon itself. See the description for bin under polygon
  369. attributes.
  370. <Scalar> draw_order { number }
  371. This specifies the fixed drawing order of all polygons with this
  372. texture applied, in the absence of a drawing order specified on
  373. the polygon itself. See the description for draw_order under
  374. polygon attributes.
  375. <Scalar> quality-level { quality }
  376. Sets a hint to the renderer about the desired performance /
  377. quality tradeoff for this particular texture. This is most useful
  378. for the tinydisplay software renderer; for normal,
  379. hardware-accelerated renderers, this may have little or no effect.
  380. This may be one of:
  381. DEFAULT
  382. FASTEST
  383. NORMAL
  384. BEST
  385. "Default" means to use whatever quality level is specified by the
  386. global texture-quality-level config variable.
  387. <Transform> { transform-definition }
  388. This specifies a 2-d or 3-d transformation that is applied to the
  389. UV's of a surface to generate the texture coordinates.
  390. The transform syntax is similar to that for groups, except it may
  391. define either a 2-d 3x3 matrix or a 3-d 4x4 matrix. (You should
  392. use the two-dimensional forms if the UV's are two-dimensional, and
  393. the three-dimensional forms if the UV's are three-dimensional.)
  394. A two-dimensional transform may be any sequence of zero or more of
  395. the following. Transformations are post multiplied in the order
  396. they are encountered to produce a net transformation matrix.
  397. Rotations are counterclockwise about the origin in degrees.
  398. Matrices, when specified explicitly, are row-major.
  399. <Translate> { x y }
  400. <Rotate> { degrees }
  401. <Scale> { x y }
  402. <Scale> { s }
  403. <Matrix3> {
  404. 00 01 02
  405. 10 11 12
  406. 20 21 22
  407. }
  408. A three-dimensional transform may be any sequence of zero or more
  409. of the following. See the description under <Group>, below, for
  410. more information.
  411. <Translate> { x y z }
  412. <RotX> { degrees }
  413. <RotY> { degrees }
  414. <RotZ> { degrees }
  415. <Rotate> { degrees x y z }
  416. <Scale> { x y z }
  417. <Scale> { s }
  418. <Matrix4> {
  419. 00 01 02 03
  420. 10 11 12 13
  421. 20 21 22 23
  422. 30 31 32 33
  423. }
  424. <Material> name { [scalars] }
  425. This defines a set of material attributes that may later be
  426. referenced with <MRef> { name }.
  427. The following attributes may appear within the material block:
  428. <Scalar> diffr { number }
  429. <Scalar> diffg { number }
  430. <Scalar> diffb { number }
  431. <Scalar> diffa { number }
  432. <Scalar> ambr { number }
  433. <Scalar> ambg { number }
  434. <Scalar> ambb { number }
  435. <Scalar> amba { number }
  436. <Scalar> emitr { number }
  437. <Scalar> emitg { number }
  438. <Scalar> emitb { number }
  439. <Scalar> emita { number }
  440. <Scalar> specr { number }
  441. <Scalar> specg { number }
  442. <Scalar> specb { number }
  443. <Scalar> speca { number }
  444. <Scalar> shininess { number }
  445. <Scalar> local { flag }
  446. These properties collectively define a "material" that controls the
  447. lighting effects that are applied to a surface; a material is only
  448. in effect in the presence of lighting.
  449. The four color groups, diff*, amb*, emit*, and spec* specify the
  450. diffuse, ambient, emission, and specular components of the lighting
  451. equation, respectively. Any of them may be omitted; the omitted
  452. component(s) take their color from the native color of the
  453. primitive, otherwise the primitive color is replaced with the
  454. material color.
  455. The shininess property controls the size of the specular highlight,
  456. and the value ranges from 0 to 128. A larger value creates a
  457. smaller highlight (creating the appearance of a shinier surface).
  458. <VertexPool> name { vertices }
  459. A vertex pool is a set of vertices. All geometry is created by
  460. referring to vertices by number in a particular vertex pool. There
  461. may be one or several vertex pools in an egg file, but all vertices
  462. that make up a single polygon must come from the same vertex pool.
  463. The body of a <VertexPool> entry is simply a list of one or more
  464. <Vertex> entries, as follows:
  465. <Vertex> number { x [y [z [w]]] [attributes] }
  466. A <Vertex> entry is only valid within a vertex pool definition.
  467. The number is the index by which this vertex will be referenced.
  468. It is optional; if it is omitted, the vertices are implicitly
  469. numbered consecutively beginning at one. If the number is
  470. supplied, the vertices need not be consecutive.
  471. Normally, vertices are three-dimensional (with coordinates x, y,
  472. and z); however, in certain cases vertices may have fewer or more
  473. dimensions, up to four. This is particularly true of vertices
  474. used as control vertices of NURBS curves and surfaces. If more
  475. coordinates are supplied than needed, the extra coordinates are
  476. ignored; if fewer are supplied than needed, the missing
  477. coordinates are assumed to be 0.
  478. The vertex's coordinates are always given in world space,
  479. regardless of any transforms before the vertex pool or before the
  480. referencing geometry. If the vertex is referenced by geometry
  481. under a transform, the egg loader will do an inverse transform to
  482. move the vertex into the proper coordinate space without changing
  483. its position in world space. One exception is geometry under an
  484. <Instance> node; in this case the vertex coordinates are given in
  485. the space of the <Instance> node. (Another exception is a
  486. <DynamicVertexPool>; see below.)
  487. In neither case does it make a difference whether the vertex pool
  488. is itself declared under a transform or an <Instance> node. The
  489. only deciding factor is whether the geometry that *uses* the
  490. vertex pool appears under an <Instance> node. It is possible for
  491. a single vertex to be interpreted in different coordinate spaces
  492. by different polygons.
  493. While each vertex must at least have a position, it may also have
  494. a color, normal, pair of UV coordinates, and/or a set of morph
  495. offsets. Furthermore, the color, normal, and UV coordinates may
  496. themselves have morph offsets. Thus, the [attributes] in the
  497. syntax line above may be replaced with zero or more of the
  498. following entries:
  499. <Dxyz> target { x y z }
  500. This specifies the offset of this vertex for the named morph
  501. target. See the "MORPH DESCRIPTION ENTRIES" header, below.
  502. <Normal> { x y z [morph-list] }
  503. This specifies the surface normal of the vertex. If omitted, the
  504. vertex will have no normal. Normals may also be morphed;
  505. morph-list here is thus an optional list of <DNormal> entries,
  506. similar to the above.
  507. <RGBA> { r g b a [morph-list] }
  508. This specifies the four-valued color of the vertex. Each
  509. component is in the range 0.0 to 1.0. A vertex color, if
  510. specified for all vertices of the polygon, overrides the polygon's
  511. color. If neither color is given, the default is white
  512. (1 1 1 1). The morph-list is an optional list of <DRGBA> entries.
  513. <UV> [name] { u v [w] [tangent] [binormal] [morph-list] }
  514. This gives the texture coordinates of the vertex. This must be
  515. specified if a texture is to be mapped onto this geometry.
  516. The texture coordinates are usually two-dimensional, with two
  517. component values (u v), but they may also be three-dimensional,
  518. with three component values (u v w). (Arguably, it should be
  519. called <UVW> instead of <UV> in the three-dimensional case, but
  520. it's not.)
  521. As before, morph-list is an optional list of <DUV> entries.
  522. Unlike the other kinds of attributes, there may be multiple sets
  523. of UV's on each vertex, each with a unique name; this provides
  524. support for multitexturing. The name may be omitted to specify
  525. the default UV's.
  526. The UV's also support an optional tangent and binormal. These
  527. values are based on the vertex normal and the UV coordinates of
  528. connected vertices, and are used to render normal maps and similar
  529. lighting effects. They are defined within the <UV> entry because
  530. there may be a different set of tangents and binormals for each
  531. different UV coordinate set. If present, they have the expected
  532. syntax:
  533. <UV> [name] { u v [w] <Tangent> { x y z } <Binormal> { x y z } }
  534. <DynamicVertexPool> name { vertices }
  535. A dynamic vertex pool is similar to a vertex pool in most respects,
  536. except that each vertex might be animated by substituting in values
  537. from a <VertexAnim> table. Also, the vertices defined within a
  538. dynamic vertex pool are always given in local coordinates, instead
  539. of world coordinates.
  540. The presence of a dynamic vertex pool makes sense only within a
  541. character model, and a single dynamic vertex pool may not span
  542. multiple characters. Each dynamic vertex pool creates a DynVerts
  543. object within the character by the same name; this name is used
  544. later when matching up the corresponding <VertexAnim>.
  545. At the present time, the DynamicVertexPool is not implemented in
  546. Panda3D.
  547. GEOMETRY ENTRIES
  548. <Polygon> name {
  549. [attributes]
  550. <VertexRef> {
  551. indices
  552. <Ref> { pool-name }
  553. }
  554. }
  555. A polygon consists of a sequence of vertices from a single vertex
  556. pool. Vertices are identified by pool-name and index number within
  557. the pool; indices is a list of vertex numbers within the given
  558. vertex pool. Vertices are listed in counterclockwise order.
  559. Although the vertices must all come from the same vertex pool, they
  560. may have been assigned to arbitrarily many different joints
  561. regardless of joint connectivity (there is no "straddle-polygon"
  562. limitation). See Joints, below.
  563. The polygon syntax is quite verbose, and there isn't any way to
  564. specify a set of attributes that applies to a group of polygons--the
  565. attributes list must be repeated for each polygon. This is why egg
  566. files tend to be very large.
  567. The following attributes may be specified for polygons:
  568. <TRef> { texture-name }
  569. This refers to a named <Texture> entry given earlier. It applies
  570. the given texture to the polygon. This requires that all the
  571. polygon's vertices have been assigned texture coordinates.
  572. This attribute may be repeated multiple times to specify
  573. multitexture. In this case, each named texture is applied to the
  574. polygon, in the order specified.
  575. <Texture> { filename }
  576. This is another way to apply a texture to a polygon. The
  577. <Texture> entry is defined "inline" to the polygon, instead of
  578. referring to a <Texture> entry given earlier. There is no way to
  579. specify texture attributes given this form.
  580. There's no advantage to this syntax for texture mapping. It's
  581. supported only because it's required by some older egg files.
  582. <MRef> { material-name }
  583. This applies the material properties defined in the earlier
  584. <Material> entry to the polygon.
  585. <Normal> { x y z [morph-list] }
  586. This defines a polygon surface normal. The polygon normal will be
  587. used unless all vertices also have a normal. If no normal is
  588. defined, none will be supplied. The polygon normal, like the
  589. vertex normal, may be morphed by specifying a series of <DNormal>
  590. entries.
  591. The polygon normal is used only for lighting and environment
  592. mapping calculations, and is not related to the implicit normal
  593. calculated for CollisionPolygons.
  594. <RGBA> { r g b a [morph-list] }
  595. This defines the polygon's color, which will be used unless all
  596. vertices also have a color. If no color is defined, the default
  597. is white (1 1 1 1). The color may be morphed with a series of
  598. <DRGBA> entries.
  599. <BFace> { boolean-value }
  600. This defines whether the polygon will be rendered double-sided
  601. (i.e. its back face will be visible). By default, this option is
  602. disabled, and polygons are one-sided; specifying a nonzero value
  603. disables backface culling for this particular polygon and allows
  604. it to be viewed from either side.
  605. <Scalar> bin { bin-name }
  606. It is sometimes important to control the order in which objects
  607. are rendered, particularly when transparency is in use. In Panda,
  608. this is achieved via the use of named bins and, within certain
  609. kinds of bins, sometimes an explicit draw_order is also used (see
  610. below).
  611. In the normal (state-sorting) mode, Panda renders its geometry by
  612. first grouping into one or more named bins, and then rendering the
  613. bins in a specified order. The programmer is free to define any
  614. number of bins, named whatever he/she desires.
  615. This scalar specifies which bin this particular polygon is to be
  616. rendered within. If no bin scalar is given, or if the name given
  617. does not match any of the known bins, the polygon will be assigned
  618. to the default bin, which renders all opaque geometry sorted by
  619. state, followed by all transparent geometry sorted back-to-front.
  620. See also draw_order, below.
  621. <Scalar> draw_order { number }
  622. This works in conjunction with bin, above, to further refine the
  623. order in which this polygon is drawn, relative to other geometry
  624. in the same bin. If (and only if) the bin type named in the bin
  625. scalar is a CullBinFixed, this draw_order is used to define the
  626. fixed order that all geometry in the same will be rendered, from
  627. smaller numbers to larger numbers.
  628. If the draw_order scalar is specified but no bin scalar is
  629. specified, the default is a bin named "fixed", which is a
  630. CullBinFixed object that always exists by default.
  631. <Scalar> visibility { hidden | normal }
  632. If the visibility of a primitive is set to "hidden", the primitive
  633. is not generated as a normally visible primitive. If the
  634. Config.prc variable egg-suppress-hidden is set to true, the
  635. primitive is not converted at all; otherwise, it is converted as a
  636. "stashed" node.
  637. This, like the other rendering flags alpha, draw_order, and bin,
  638. may be specified at the group level, within the primitive level,
  639. or even within a texture.
  640. <PointLight> name {
  641. [attributes]
  642. <VertexRef> {
  643. indices
  644. <Ref> { pool-name }
  645. }
  646. }
  647. A PointLight is a set of single points. One point is drawn for each
  648. vertex listed in the <VertexRef>. Normals, textures, and colors may
  649. be specified for PointLights, as well as draw_order, plus one
  650. additional attribute valid only for PointLights and Lines:
  651. <Scalar> thick { number }
  652. This specifies the size of the PointLight (or the width of a
  653. line), in pixels, when it is rendered. This may be a
  654. floating-point number, but the fractional part is meaningful only
  655. when antialiasing is in effect. The default is 1.0.
  656. <Scalar> perspective { boolean-value }
  657. If this is specified, then the thickness, above, is to interpreted
  658. as a size in 3-d spatial units, rather than a size in pixels, and
  659. the point should be scaled according to its distance from the
  660. viewer normally.
  661. <Line> name {
  662. [attributes]
  663. <VertexRef> {
  664. indices
  665. <Ref> { pool-name }
  666. }
  667. [component attributes]
  668. }
  669. A Line is a connected set of line segments. The listed N vertices
  670. define a series of N-1 line segments, drawn between vertex 0 and
  671. vertex 1, vertex 1 and vertex 2, etc. The line is not implicitly
  672. closed; if you wish to represent a loop, you must repeat vertex 0 at
  673. the end. As with a PointLight, normals, textures, colors,
  674. draw_order, and the "thick" attribute are all valid (but not
  675. "perspective"). Also, since a Line (with more than two vertices) is
  676. made up of multiple line segments, it may contain a number of
  677. <Component> entries, to set a different color and/or normal for each
  678. line segment, as in TriangleStrip, below.
  679. <TriangleStrip> name {
  680. [attributes]
  681. <VertexRef> {
  682. indices
  683. <Ref> { pool-name }
  684. }
  685. [component attributes]
  686. }
  687. A triangle strip is only rarely encountered in an egg file; it is
  688. normally generated automatically only during load time, when
  689. connected triangles are automatically meshed for loading, and even
  690. then it exists only momentarily. Since a triangle strip is a
  691. rendering optimization only and adds no useful scene information
  692. over a loose collection of triangles, its usage is contrary to the
  693. general egg philosophy of representing a scene in the abstract.
  694. Nevertheless, the syntax exists, primarily to allow inspection of
  695. the meshing results when needed. You can also add custom
  696. TriangleStrip entries to force a particular mesh arrangement.
  697. A triangle strip is defined as a series of connected triangles.
  698. After the first three vertices, which define the first triangle,
  699. each new vertex defines one additional triangle, by alternating up
  700. and down.
  701. It is possible for the individual triangles of a triangle strip to
  702. have a separate normal and/or color. If so, a <Component> entry
  703. should be given for each so-modified triangle:
  704. <Component> index {
  705. <RGBA> { r g b a [morph-list] }
  706. <Normal> { x y z [morph-list] }
  707. }
  708. Where index ranges from 0 to the number of components defined by the
  709. triangle strip (less 1). Note that the component attribute list
  710. must always follow the vertex list.
  711. <TriangleFan> name {
  712. [attributes]
  713. <VertexRef> {
  714. indices
  715. <Ref> { pool-name }
  716. }
  717. [component attributes]
  718. }
  719. A triangle fan is similar to a triangle strip, except all of the
  720. connected triangles share the same vertex, which is the first
  721. vertex. See <TriangleStrip>, above.
  722. PARAMETRIC DESCRIPTION ENTRIES
  723. The following entries define parametric curves and surfaces.
  724. Generally, Panda supports these only in the abstract; they're not
  725. geometry in the true sense but do exist in the scene graph and may
  726. have specific meaning to the application. However, Panda can create
  727. visible representations of these parametrics to aid visualization.
  728. These entries might also have meaning to external tools outside of an
  729. interactive Panda session, such as egg-qtess, which can be used to
  730. convert NURBS surfaces to polygons at different levels of resolution.
  731. In general, dynamic attributes such as morphs and joint assignment are
  732. legal for the control vertices of the following parametrics, but Panda
  733. itself doesn't support them and will always create static curves and
  734. surfaces. External tools like egg-qtess, however, may respect them.
  735. <NURBSCurve> {
  736. [attributes]
  737. <Order> { order }
  738. <Knots> { knot-list }
  739. <VertexRef> { indices <Ref> { pool-name } }
  740. }
  741. A NURBS curve is a general parametric curve. It is often used to
  742. represent a motion path, e.g. for a camera or an object.
  743. The order is equal to the degree of the polynomial basis plus 1. It
  744. must be an integer in the range [1,4].
  745. The number of vertices must be equal to the number of knots minus the
  746. order.
  747. Each control vertex of a NURBS is defined in homogeneous space with
  748. four coordinates x y z w (to convert to 3-space, divide x, y, and z
  749. by w). The last coordinate is always the homogeneous coordinate; if
  750. only three coordinates are given, it specifies a curve in two
  751. dimensions plus a homogeneous coordinate (x y w).
  752. The following attributes may be defined:
  753. <Scalar> type { curve-type }
  754. This defines the semanting meaning of this curve, either XYZ, HPR,
  755. or T. If the type is XYZ, the curve will automatically be
  756. transformed between Y-up and Z-up if necessary; otherwise, it will
  757. be left alone.
  758. <Scalar> subdiv { num-segments }
  759. If this scalar is given and nonzero, Panda will create a visible
  760. representation of the curve when the scene is loaded. The number
  761. represents the number of line segments to draw to approximate the
  762. curve.
  763. <RGBA> { r g b a [morph-list] }
  764. This specifies the color of the overall curve.
  765. NURBS control vertices may also be given color and/or morph
  766. attributes, but <Normal> and <UV> entries do not apply to NURBS
  767. vertices.
  768. <NURBSSurface> name {
  769. [attributes]
  770. <Order> { u-order v-order }
  771. <U-knots> { u-knot-list }
  772. <V-knots> { v-knot-list }
  773. <VertexRef> {
  774. indices
  775. <Ref> { pool-name }
  776. }
  777. }
  778. A NURBS surface is an extension of a NURBS curve into two parametric
  779. dimensions, u and v. NURBS surfaces may be given the same set of
  780. attributes assigned to polygons, except for normals: <TRef>,
  781. <Texture>, <MRef>, <RGBA>, and draw_order are all valid attributes
  782. for NURBS. NURBS vertices, similarly, may be colored or morphed,
  783. but <Normal> and <UV> entries do not apply to NURBS vertices. The
  784. attributes may also include <NURBSCurve> and <Trim> entries; see
  785. below.
  786. To have Panda create a visualization of a NURBS surface, the
  787. following two attributes should be defined as well:
  788. <Scalar> U-subdiv { u-num-segments }
  789. <Scalar> V-subdiv { v-num-segments }
  790. These define the number of subdivisions to make in the U and V
  791. directions to represent the surface. A uniform subdivision is
  792. always made, and trim curves are not respected (though they will
  793. be drawn in if the trim curves themselves also have a subiv
  794. parameter). This is only intended as a cheesy visualization.
  795. The same sort of restrictions on order and knots applies to NURBS
  796. surfaces as do to NURBS curves. The order and knot description may
  797. be different in each dimension.
  798. The surface must have u-num * v-num vertices, where u-num is the
  799. number of u-knots minus the u-order, and v-num is the number of
  800. v-knots minus the v-order. All vertices must come from the same
  801. vertex pool. The nth (zero-based) index number defines control
  802. vertex (u, v) of the surface, where n = (v * u-num) + u. Thus, it
  803. is the u coordinate which changes faster.
  804. As with the NURBS curve, each control vertex is defined in
  805. homogeneous space with four coordinates x y z w.
  806. A NURBS may also contain curves on its surface. These are one or
  807. more nested <NURBSCurve> entries included with the attributes; these
  808. curves are defined in the two-dimensional parametric space of the
  809. surface. Thus, these curve vertices should have only two dimensions
  810. plus the homogeneous coordinate: u v w. A curve-on-surface has no
  811. intrinsic meaning to the surface, unless it is defined within a
  812. <Trim> entry, below.
  813. Finally, a NURBS may be trimmed by one or more trim curves. These
  814. are special curves on the surface which exclude certain areas from
  815. the NURBS surface definition. The inside is specified using two
  816. rules: an odd winding rule that states that the inside consists of
  817. all regions for which an infinite ray from any point in the region
  818. will intersect the trim curve an odd number of times, and a curve
  819. orientation rule that states that the inside consists of the regions
  820. to the left as the curve is traced.
  821. Each trim curve contains one or more loops, and each loop contains
  822. one or more NURBS curves. The curves of a loop connect in a
  823. head-to-tail fashion and must be explicitly closed.
  824. The trim curve syntax is as follows:
  825. <Trim> {
  826. <Loop> {
  827. <NURBSCurve> {
  828. <Order> { order }
  829. <Knots> { knot-list }
  830. <VertexRef> { indices <Ref> { pool-name } }
  831. }
  832. [ <NURBSCurve> { ... } ... ]
  833. }
  834. [ <Loop> { ... } ... ]
  835. }
  836. Although the egg syntax supports trim curves, there are at present
  837. no egg processing tools that respect them. For instance, egg-qtess
  838. ignores trim curves and always tesselates the entire NURBS surface.
  839. MORPH DESCRIPTION ENTRIES
  840. Morphs are linear interpolations of attribute values at run time,
  841. according to values read from an animation table. In general, vertex
  842. positions, surface normals, texture coordinates, and colors may be
  843. morphed.
  844. A morph target is defined by giving a net morph offset for a series of
  845. vertex or polygon attributes; this offset is the value that will be
  846. added to the attribute when the morph target has the value 1.0. At
  847. run time, the morph target's value may be animated to any scalar value
  848. (but generally between 0.0 and 1.0); the corresponding fraction of the
  849. offset is added to the attribute each frame.
  850. There is no explicit morph target definition; a morph target exists
  851. solely as the set of all offsets that share the same target name. The
  852. target name may be any arbitrary string; like any name in an egg file,
  853. it should be quoted if it contains special characters.
  854. The following types of morph offsets may be defined, within their
  855. corresponding attribute entries:
  856. <Dxyz> target { x y z }
  857. A position delta, valid within a <Vertex> entry or a <CV> entry.
  858. The given offset vector, scaled by the morph target's value, is
  859. added to the vertex or CV position each frame.
  860. <DNormal> target { x y z }
  861. A normal delta, similar to the position delta, valid within a
  862. <Normal> entry (for vertex or polygon normals). The given offset
  863. vector, scaled by the morph target's value, is added to the normal
  864. vector each frame. The resulting vector may not be automatically
  865. normalized to unit length.
  866. <DUV> target { u v [w] }
  867. A texture-coordinate delta, valid within a <UV> entry (within a
  868. <Vertex> entry). The offset vector should be 2-valued if the
  869. enclosing UV is 2-valued, or 3-valued if the enclosing UV is
  870. 3-valued. The given offset vector, scaled by the morph target's
  871. value, is added to the vertex's texture coordinates each frame.
  872. <DRGBA> target { r g b a }
  873. A color delta, valid within an <RGBA> entry (for vertex or polygon
  874. colors). The given 4-valued offset vector, scaled by the morph
  875. target's value, is added to the color value each frame.
  876. GROUPING ENTRIES
  877. <Group> name { group-body }
  878. A <Group> node is the primary means of providing structure to the
  879. egg file. Groups can contain vertex pools and polygons, as well as
  880. other groups. The egg loader translates <Group> nodes directly into
  881. PandaNodes in the scene graph (although the egg loader reserves the
  882. right to arbitrarily remove nodes that it deems unimportant--see the
  883. <Model> flag, below to avoid this). In addition, the following
  884. entries can be given specifically within a <Group> node to specify
  885. attributes of the group:
  886. GROUP BINARY ATTRIBUTES
  887. These attributes may be either on or off; they are off by default.
  888. They are turned on by specifying a non-zero "boolean-value".
  889. <DCS> { boolean-value }
  890. DCS stands for Dynamic Coordinate System. This indicates that
  891. show code will expect to be able to read the transform set on this
  892. node at run time, and may need to modify the transform further.
  893. This is a special case of <Model>, below.
  894. <DCS> { dcs-type }
  895. This is another syntax for the <DCS> flag. The dcs-type string
  896. should be one of either "local" or "net", which specifies the kind
  897. of preserve_transform flag that will be set on the corresponding
  898. ModelNode. If the string is "local", it indicates that the local
  899. transform on this node (as well as the net transform) will not be
  900. affected by any flattening operation and will be preserved through
  901. the entire model loading process. If the string is "net", then
  902. only the net transform will be preserved; the local transform may
  903. be adjusted in the event of a flatten operation.
  904. <Model> { boolean-value }
  905. This indicates that the show code might need a pointer to this
  906. particular group. This creates a ModelNode at the corresponding
  907. level, which is guaranteed not to be removed by any flatten
  908. operation. However, its transform might still be changed, but see
  909. also the <DCS> flag, above.
  910. <Dart> { boolean-value }
  911. This indicates that this group begins an animated character. A
  912. Character node, which is the fundamental animatable object of
  913. Panda's high-level Actor class, will be created for this group.
  914. This flag should always be present within the <Group> entry at the
  915. top of any hierarchy of <Joint>'s and/or geometry with morphed
  916. vertices; joints and morphs appearing outside of a hierarchy
  917. identified with a <Dart> flag are undefined.
  918. <Switch> { boolean-value }
  919. This attribute indicates that the child nodes of this group
  920. represent a series of animation frames that should be
  921. consecutively displayed. In the absence of an "fps" scalar for
  922. the group (see below), the egg loader creates a SwitchNode, and it
  923. the responsibility of the show code to perform the switching. If
  924. an fps scalar is defined and is nonzero, the egg loader creates a
  925. SequenceNode instead, which automatically cycles through its
  926. children.
  927. GROUP SCALARS
  928. <Scalar> fps { frame-rate }
  929. This specifies the rate of animation for a SequenceNode (created
  930. when the Switch flag is specified, see above). A value of zero
  931. indicates a SwitchNode should be created instead.
  932. <Scalar> bin { bin-name }
  933. This specifies the bin name for all polygons at or below this node
  934. that do not explicitly set their own bin. See the description of
  935. bin for geometry attributes, above.
  936. <Scalar> draw_order { number }
  937. This specifies the drawing order for all polygons at or below this
  938. node that do not explicitly set their own drawing order. See the
  939. description of draw_order for geometry attributes, above.
  940. <Scalar> visibility { hidden | normal }
  941. If the visibility of a group is set to "hidden", the primitives
  942. nested within that group are not generated as a normally visible
  943. primitive. If the Config.prc variable egg-suppress-hidden is set
  944. to true, the primitives are not converted at all; otherwise, they
  945. are converted as a "stashed" node.
  946. <Scalar> decal { boolean-value }
  947. If this is present and boolean-value is non-zero, it indicates
  948. that the geometry *below* this level is coplanar with the geometry
  949. *at* this level, and the geometry below is to be drawn as a decal
  950. onto the geometry at this level. This means the geometry below
  951. this level will be rendered "on top of" this geometry, but without
  952. the Z-fighting artifacts one might expect without the use of the
  953. decal flag.
  954. <Scalar> decalbase { boolean-value }
  955. This can optionally be used with the "decal" scalar, above. If
  956. present, it should be applied to a sibling of one or more nodes
  957. with the "decal" scalar on. It indicates which of the sibling
  958. nodes should be treated as the base of the decal. In the absence
  959. of this scalar, the parent of all decal nodes is used as the decal
  960. base. This scalar is useful when the modeling package is unable
  961. to parent geometry nodes to other geometry nodes.
  962. <Scalar> collide-mask { value }
  963. <Scalar> from-collide-mask { value }
  964. <Scalar> into-collide-mask { value }
  965. Sets the CollideMasks on the collision nodes and geometry nodes
  966. created at or below this group to the indicated values. These
  967. are bits that indicate which objects can collide with which
  968. other objects. Setting "collide-mask" is equivalent to setting
  969. both "from-collide-mask" and "into-collide-mask" to the same
  970. value.
  971. The value may be an ordinary decimal integer, or a hex number in
  972. the form 0x000, or a binary number in the form 0b000.
  973. <Scalar> blend { mode }
  974. Specifies that a special blend mode should be applied geometry at
  975. this level and below. The available options are none, add,
  976. subtract, inv-subtract, min, and max. See ColorBlendAttrib.
  977. <Scalar> blendop-a { mode }
  978. <Scalar> blendop-b { mode }
  979. If blend mode, above, is not none, this specifies the A and B
  980. operands to the blend equation. Common options are zero, one,
  981. incoming-color, one-minus-incoming-color. See ColorBlendAttrib
  982. for the complete list of available options. The default is "one".
  983. <Scalar> blendr { red-value }
  984. <Scalar> blendg { green-value }
  985. <Scalar> blendb { blue-value }
  986. <Scalar> blenda { alpha-value }
  987. If blend mode, above, is not none, and one of the blend operands
  988. is constant-color or a related option, this defines the constant
  989. color that will be used.
  990. OTHER GROUP ATTRIBUTES
  991. <Billboard> { type }
  992. This entry indicates that all geometry defined at or below this
  993. group level is part of a billboard that will rotate to face the
  994. camera. Type is either "axis" or "point", describing the type of
  995. rotation.
  996. Billboards rotate about their local axis. In the case of a Y-up
  997. file, the billboards rotate about the Y axis; in a Z-up file, they
  998. rotate about the Z axis. Point-rotation billboards rotate about
  999. the origin.
  1000. There is an implicit <Instance> around billboard geometry. This
  1001. means that the geometry within a billboard is not specified in
  1002. world coordinates, but in the local billboard space. Thus, a
  1003. vertex drawn at point 0,0,0 will appear to be at the pivot point
  1004. of the billboard, not at the origin of the scene.
  1005. <SwitchCondition> {
  1006. <Distance> {
  1007. in out [fade] <Vertex> { x y z }
  1008. }
  1009. }
  1010. The subtree beginning at this node and below represents a single
  1011. level of detail for a particular model. Sibling nodes represent
  1012. the additional levels of detail. The geometry at this node will
  1013. be visible when the point (x, y, z) is closer than "in" units, but
  1014. further than "out" units, from the camera. "fade" is presently
  1015. ignored.
  1016. <Tag> key { value }
  1017. This attribute defines the indicated tag (as a key/value pair),
  1018. retrievable via NodePath::get_tag() and related interfaces, on
  1019. this node.
  1020. <Collide> name { type [flags] }
  1021. This entry indicates that geometry defined at this group level is
  1022. actually an invisible collision surface, and is not true geometry.
  1023. The geometry is used to define the extents of the collision
  1024. surface. If there is no geometry defined at this level, then a
  1025. child is searched for with the same collision type specified, and
  1026. its geometry is used to define the extent of the collision
  1027. surface (unless the "descend" flag is given; see below).
  1028. Valid types so far are:
  1029. Plane
  1030. The geometry represents an infinite plane. The first polygon
  1031. found in the group will define the plane.
  1032. Polygon
  1033. The geometry represents a single polygon. The first polygon is
  1034. used.
  1035. Polyset
  1036. The geometry represents a complex shape made up of several
  1037. polygons. This collision type should not be overused, as it
  1038. provides the least optimization benefit.
  1039. Sphere
  1040. The geometry represents a sphere. The vertices in the group are
  1041. averaged together to determine the sphere's center and radius.
  1042. InvSphere
  1043. The geometry represents an inverse sphere. This is the same as
  1044. Sphere, with the normal inverted, so that the solid part of an
  1045. inverse sphere is the entire world outside of it. Note that an
  1046. inverse sphere is in infinitely large solid with a finite hole
  1047. cut into it.
  1048. Tube
  1049. The geometry represents a tube. This is a cylinder-like shape
  1050. with hemispherical endcaps; it is sometimes called a capsule or
  1051. a lozenge in other packages. The smallest tube shape that will
  1052. fit around the vertices is used.
  1053. The flags may be any zero or more of:
  1054. event
  1055. Throws the name of the <Collide> entry, or the name of the
  1056. surface if the <Collide> entry has no name, as an event whenever
  1057. an avatar strikes the solid. This is the default if the
  1058. <Collide> entry has a name.
  1059. intangible
  1060. Rather than being a solid collision surface, the defined surface
  1061. represents a boundary. The name of the surface will be thrown
  1062. as an event when an avatar crosses into the interior, and
  1063. name-out will be thrown when an avater exits.
  1064. descend
  1065. Instead of creating only one collision object of the given type,
  1066. each group descended from this node that contains geometry will
  1067. define a new collision object of the given type. The event
  1068. name, if any, will also be inherited from the top node and
  1069. shared among all the collision objects.
  1070. keep
  1071. Don't discard the visible geometry after using it to define a
  1072. collision surface; create both an invisible collision surface
  1073. and the visible geometry.
  1074. level
  1075. Stores a special effective normal with the collision solid that
  1076. points up, regardless of the actual shape or orientation of the
  1077. solid. This can be used to allow an avatar to stand on a
  1078. sloping surface without having a tendency to slide downward.
  1079. <ObjectType> { type }
  1080. This is a short form to indicate one of several pre-canned sets of
  1081. attributes. Type may be any word, and a Config definition will be
  1082. searched for by the name "egg-object-type-word", where "word" is
  1083. the type word. This definition may contain any arbitrary egg
  1084. syntax to be parsed in at this group level.
  1085. A number of predefined ObjectType definitions are provided:
  1086. barrier
  1087. This is equivalent to <Collide> { Polyset descend }. The
  1088. geometry defined at this root and below defines an invisible
  1089. collision solid.
  1090. trigger
  1091. This is equivalent to <Collide> { Polyset descend intangible }.
  1092. The geometry defined at this root and below defines an invisible
  1093. trigger surface.
  1094. sphere
  1095. Equivalent to <Collide> { Sphere descend }. The geometry is
  1096. replaced with the smallest collision sphere that will enclose
  1097. it. Typically you model a sphere in polygons and put this flag
  1098. on it to create a collision sphere of the same size.
  1099. tube
  1100. Equivalent to <Collide> { Tube descend }. As in sphere, above,
  1101. but the geometry is replaced with a collision tube (a capsule).
  1102. Typically you will model a capsule or a cylinder in polygons.
  1103. bubble
  1104. Equivalent to <Collide> { Sphere keep descend }. A collision
  1105. bubble is placed around the geometry, which is otherwise
  1106. unchanged.
  1107. ghost
  1108. Equivalent to <Scalar> collide-mask { 0 }. It means that the
  1109. geometry beginning at this node and below should never be
  1110. collided with--characters will pass through it.
  1111. backstage
  1112. This has no equivalent; it is treated as a special case. It
  1113. means that the geometry at this node and below should not be
  1114. translated. This will normally be used on scale references and
  1115. other modeling tools.
  1116. There may also be additional predefined egg object types not
  1117. listed here; see the *.pp files that are installed into the etc
  1118. directory for a complete list.
  1119. <Transform> { transform-definition }
  1120. This specifies a matrix transform at this group level. This
  1121. defines a local coordinate space for this group and its
  1122. descendents. Vertices are still specified in world coordinates
  1123. (in a vertex pool), but any geometry assigned to this group will
  1124. be inverse transformed to move its vertices to the local space.
  1125. The transform definition may be any sequence of zero or more of
  1126. the following. Transformations are post multiplied in the order
  1127. they are encountered to produce a net transformation matrix.
  1128. Rotations are defined as a counterclockwise angle in degrees about
  1129. a particular axis, either implicit (about the x, y, or z axis), or
  1130. arbitrary. Matrices, when specified explicitly, are row-major.
  1131. <Translate> { x y z }
  1132. <RotX> { degrees }
  1133. <RotY> { degrees }
  1134. <RotZ> { degrees }
  1135. <Rotate> { degrees x y z }
  1136. <Scale> { x y z }
  1137. <Scale> { s }
  1138. <Matrix4> {
  1139. 00 01 02 03
  1140. 10 11 12 13
  1141. 20 21 22 23
  1142. 30 31 32 33
  1143. }
  1144. Note that the <Transform> block should always define a 3-d
  1145. transform when it appears within the body of a <Group>, while it
  1146. may define either a 2-d or a 3-d transform when it appears within
  1147. the body of a <Texture>. See <Texture>, above.
  1148. <DefaultPose> { transform-definition }
  1149. This defines an optional default pose transform, which might be a
  1150. different transform from that defined by the <Transform> entry,
  1151. above. This makes sense only for a <Joint>. See the <Joint>
  1152. description, below.
  1153. The default pose transform defines the transform the joint will
  1154. maintain in the absence of any animation being applied. This is
  1155. different from the <Transform> entry, which defines the coordinate
  1156. space the joint must have in order to keep its vertices in their
  1157. (global space) position as given in the egg file. If this is
  1158. different from the <Transform> entry, the joint's vertices will
  1159. *not* be in their egg file position at initial load. If there is
  1160. no <DefaultPose> entry for a particular joint, the implicit
  1161. default-pose transform is the same as the <Transform> entry.
  1162. Normally, the <DefaultPose> entry, if any, is created by the
  1163. egg-optchar -defpose option. Most other software has little
  1164. reason to specify an explicit <DefaultPose>.
  1165. <VertexRef> { indices <Ref> { pool-name } }
  1166. This moves geometry created from the named vertices into the
  1167. current group, regardless of the group in which the geometry is
  1168. actually defined. See the <Joint> description, below.
  1169. <AnimPreload> {
  1170. <Scalar> fps { float-value }
  1171. <Scalar> num-frames { integer-value }
  1172. }
  1173. One or more AnimPreload entries may appear within the <Group> that
  1174. contains a <Dart> entry, indicating an animated character (see
  1175. above). These AnimPreload entries record the minimal preloaded
  1176. animation data required in order to support asynchronous animation
  1177. binding. These entries are typically generated by the egg-optchar
  1178. program with the -preload option, and are used by the Actor code
  1179. when allow-async-bind is True (the default).
  1180. <Instance> name { group-body }
  1181. An <Instance> node is exactly like a <Group> node, except that
  1182. vertices referenced by geometry created under the <Instance> node
  1183. are not assumed to be given in world coordinates, but are instead
  1184. given in the local space of the <Instance> node itself (including
  1185. any transforms given to the node).
  1186. In other words, geometry under an <Instance> node is defined in
  1187. local coordinates. In principle, similar geometry can be created
  1188. under several different <Instance> nodes, and thus can be positioned
  1189. in a different place in the scene each instance. This doesn't
  1190. necessarily imply the use of shared geometry in the Panda3D scene
  1191. graph, but see the <Ref> syntax, below.
  1192. This is particularly useful in conjunction with a <File> entry, to
  1193. load external file references at places other than the origin.
  1194. A special syntax of <Instance> entries does actually create shared
  1195. geometry in the scene graph. The syntax is:
  1196. <Instance> name {
  1197. <Ref> { group-name }
  1198. [ <Ref> { group-name } ... ]
  1199. }
  1200. In this case, the referenced group name will appear as a duplicate
  1201. instance in this part of the tree. Local transforms can be applied
  1202. and are relative to the referencing group's transform. The
  1203. referenced group must appear preceding this point in the egg file,
  1204. and it will also be a part of the scene in the point at which it
  1205. first appears. The referenced group may be either a <Group> or an
  1206. <Instance> of its own; usually, it is a <Group> nested within an
  1207. earlier <Instance> entry.
  1208. <Joint> name { [transform] [ref-list] [joint-list] }
  1209. A joint is a highly specialized kind of grouping node. A tree of
  1210. joints is used to specify the skeletal structure of an animated
  1211. character.
  1212. A joint may only contain one of three things. It may contain a
  1213. <Transform> entry, as above, which defines the joint's unanimated
  1214. (rest) position; it may contain lists of assigned vertices or CV's;
  1215. and it may contain other joints.
  1216. A tree of <Joint> nodes only makes sense within a character
  1217. definition, which is created by applying the <DART> flag to a group.
  1218. See <DART>, above.
  1219. The vertex assignment is crucial. This is how the geometry of a
  1220. character is made to move with the joints. The character's geometry
  1221. is actually defined outside the joint tree, and each vertex must be
  1222. assigned to one or more joints within the tree.
  1223. This is done with zero or more <VertexRef> entries per joint, as the
  1224. following:
  1225. <VertexRef> { indices [<Scalar> membership { m }] <Ref> { pool-name } }
  1226. This is syntactically similar to the way vertices are assigned to
  1227. polygons. Each <VertexRef> entry can assign vertices from only one
  1228. vertex pool (but there may be many <VertexRef> entries per joint).
  1229. Indices is a list of vertex numbers from the specied vertex pool, in
  1230. an arbitrary order.
  1231. The membership scalar is optional. If specified, it is a value
  1232. between 0.0 and 1.0 that indicates the fraction of dominance this
  1233. joint has over the vertices. This is used to implement
  1234. soft-skinning, so that each vertex may have partial ownership in
  1235. several joints.
  1236. The <VertexRef> entry may also be given to ordinary <Group> nodes.
  1237. In this case, it treats the geometry as if it was parented under the
  1238. group in the first place. Non-total membership assignments are
  1239. meaningless.
  1240. <Bundle> name { table-list }
  1241. <Table> name { table-body }
  1242. A table is a set of animated values for joints. A tree of tables
  1243. with the same structure as the corresponding tree of joints must be
  1244. defined for each character to be animated. Such a tree is placed
  1245. under a <Bundle> node, which provides a handle within Panda to the
  1246. tree as a whole.
  1247. Bundles may only contain tables; tables may contain more tables,
  1248. bundles, or any one of the following (<Scalar> entries are optional,
  1249. and default as shown):
  1250. <S$Anim> name {
  1251. <Scalar> fps { 24 }
  1252. <V> { values }
  1253. }
  1254. This is a table of scalar values, one per frame. This may be
  1255. applied to a morph slider, for instance.
  1256. <Xfm$Anim> name {
  1257. <Scalar> fps { 24 }
  1258. <Scalar> order { srpht }
  1259. <Scalar> contents { ijkabcrphxyz }
  1260. <V> { values }
  1261. }
  1262. This is a table of matrix transforms, one per frame, such as may
  1263. be applied to a joint. The "contents" string consists of a subset
  1264. of the letters "ijkabcrphxyz", where each letter corresponds to a
  1265. column of the table; <V> is a list of numbers of length(contents)
  1266. * num_frames. Each letter of the contents string corresponds to a
  1267. type of transformation:
  1268. i, j, k - scale in x, y, z directions, respectively
  1269. a, b, c - shear in xy, xz, and yz planes, respectively
  1270. r, p, h - rotate by pitch, heading, roll
  1271. x, y, z - translate in x, y, z directions
  1272. The net transformation matrix specified by each row of the table
  1273. is defined as the net effect of each of the individual columns'
  1274. transform, according to the corresponding letter in the contents
  1275. string. The order the transforms are applied is defined by the
  1276. order string:
  1277. s - all scale and shear transforms
  1278. r, p, h - individual rotate transforms
  1279. t - all translation transforms
  1280. <Xfm$Anim_S$> name {
  1281. <Scalar> fps { 24 }
  1282. <Scalar> order { srpht }
  1283. <S$Anim> i { ... }
  1284. <S$Anim> j { ... }
  1285. ...
  1286. }
  1287. This is a variant on the <Xfm$Anim> entry, where each column of
  1288. the table is entered as a separate <S$Anim> table. This syntax
  1289. reflects an attempt to simplify the description by not requiring
  1290. repetition of values for columns that did not change value during
  1291. an animation sequence.
  1292. <VertexAnim> name {
  1293. <Scalar> width { table-width }
  1294. <Scalar> fps { 24 }
  1295. <V> { values }
  1296. }
  1297. This is a table of vertex positions, normals, texture coordinates,
  1298. or colors. These values will be subsituted at runtime for the
  1299. corresponding values in a <DynamicVertexPool>. The name of the
  1300. table should be "coords", "norms", "texCoords", or "colors",
  1301. according to the type of values defined. The number table-width
  1302. is the number of floats in each row of the table. In the case of
  1303. a coords or norms table, this must be 3 times the number of
  1304. vertices in the corresponding dynamic vertex pool. (For texCoords
  1305. and colors, this number must be 2 times and 4 times, respectively.)
  1306. MISCELLANEOUS
  1307. <File> { filename }
  1308. This includes a copy of the referenced egg file at the current
  1309. point. This is usually placed under an <Instance> node, so that the
  1310. current transform will apply to the geometry in the external file.
  1311. The extension ".egg" is implied if it is omitted.
  1312. As with texture filenames, the filename may be a relative path, in
  1313. which case the current egg file's directory is searched first, and
  1314. then the model-path is searched.
  1315. ANIMATION STRUCTURE
  1316. Unanimated models may be defined in egg files without much regard to
  1317. any particular structure, so long as named entries like VertexPools
  1318. and Textures appear before they are referenced.
  1319. However, a certain rigid structural convention must be followed in
  1320. order to properly define an animated skeleton-morph model and its
  1321. associated animation data.
  1322. The structure for an animated model should resemble the following:
  1323. <Group> CHARACTER_NAME {
  1324. <Dart> { 1 }
  1325. <Joint> JOINT_A {
  1326. <Transform> { ... }
  1327. <VertexRef> { ... }
  1328. <Group> { <Polygon> ... }
  1329. <Joint> JOINT_B {
  1330. <Transform> { ... }
  1331. <VertexRef> { ... }
  1332. <Group> { <Polygon> ... }
  1333. }
  1334. <Joint> JOINT_C {
  1335. <Transform> { ... }
  1336. <VertexRef> { ... }
  1337. <Group> { <Polygon> ... }
  1338. }
  1339. ...
  1340. }
  1341. }
  1342. The <Dart> flag is necessary to indicate that this group begins an
  1343. animated model description. Without the <Dart> flag, joints will be
  1344. treated as ordinary groups, and morphs will be ignored.
  1345. In the above, UPPERCASE NAMES represent an arbitrary name that you
  1346. may choose. The name of the enclosing group, CHARACTER_NAME, is
  1347. taken as the name of the animated model. It should generally match
  1348. the bundle name in the associated animation tables.
  1349. Within the <Dart> group, you may define an arbitrary hierarchy of
  1350. <Joint> entries. There may be as many <Joint> entries as you like,
  1351. and they may have any nesting complexity you like. There may be
  1352. either one root <Joint>, or multiple roots. However, you must
  1353. always include at least one <Joint>, even if your animation consists
  1354. entirely of morphs.
  1355. Polygons may be directly attached to joints by enclosing them within
  1356. the <Joint> group, perhaps with additional nesting <Group> entries,
  1357. as illustrated above. This will result in the polygon's vertices
  1358. being hard-assigned to the joint it appears within. Alternatively,
  1359. you declare the polygons elsewhere in the egg file, and use
  1360. <VertexRef> entries within the <Joint> group to associate the
  1361. vertices with the joints. This is the more common approach, since
  1362. it allows for soft-assignment of vertices to multiple joints.
  1363. It is not necessary for every joint to have vertices at all. Every
  1364. joint should include a transform entry, however, which defines the
  1365. initial, resting transform of the joint (but see also <DefaultPose>,
  1366. above). If a transform is omitted, the identity transform is
  1367. assumed.
  1368. Some of the vertex definitions may include morph entries, as
  1369. described in MORPH DESCRIPTION ENTRIES, above. These are meaningful
  1370. only for vertices that are assigned, either implicitly or
  1371. explicitly, to at least one joint.
  1372. You may have multiple versions of a particular animated model--for
  1373. instance, multiple different LOD's, or multiple different clothing
  1374. options. Normally each different version is stored in a different
  1375. egg file, but it is also possible to include multiple versions
  1376. within the same egg file. If the different versions are intended to
  1377. play the same animations, they should all have the same
  1378. CHARACTER_NAME, and their joint hierarchies should exactly match in
  1379. structure and names.
  1380. The structure for an animation table should resemble the following:
  1381. <Table> {
  1382. <Bundle> CHARACTER_NAME {
  1383. <Table> "<skeleton>" {
  1384. <Table> JOINT_A {
  1385. <Xfm$Anim_S$> xform {
  1386. <Char*> order { sphrt }
  1387. <Scalar> fps { 24 }
  1388. <S$Anim> x { 0 0 10 10 20 ... }
  1389. <S$Anim> y { 0 0 0 0 0 ... }
  1390. <S$Anim> z { 20 20 20 20 20 ... }
  1391. }
  1392. <Table> JOINT_B {
  1393. <Xfm$Anim_S$> xform {
  1394. <Char*> order { sphrt }
  1395. <Scalar> fps { 24 }
  1396. <S$Anim> x { ... }
  1397. <S$Anim> y { ... }
  1398. <S$Anim> z { ... }
  1399. }
  1400. }
  1401. <Table> JOINT_C {
  1402. <Xfm$Anim_S$> xform {
  1403. <Char*> order { sphrt }
  1404. <Scalar> fps { 24 }
  1405. <S$Anim> x { ... }
  1406. <S$Anim> y { ... }
  1407. <S$Anim> z { ... }
  1408. }
  1409. }
  1410. }
  1411. }
  1412. <Table> morph {
  1413. <S$Anim> MORPH_A {
  1414. <Scalar> fps { 24 }
  1415. <V> { 0 0 0 0.1 0.2 0.3 1 ... }
  1416. }
  1417. <S$Anim> MORPH_B {
  1418. <Scalar> fps { 24 }
  1419. <V> { ... }
  1420. }
  1421. <S$Anim> MORPH_C {
  1422. <Scalar> fps { 24 }
  1423. <V> { ... }
  1424. }
  1425. }
  1426. }
  1427. }
  1428. The <Bundle> entry begins an animation table description. This
  1429. entry must have at least one child: a <Table> named "<skeleton>"
  1430. (this name is a literal keyword and must be present). The children
  1431. of this <Table> entry should be a hierarchy of additional <Table>
  1432. entries, one for each joint in the model. The joint structure and
  1433. names defined by the <Table> hierarchy should exactly match the
  1434. joint structure and names defined by the <Joint> hierarchy in the
  1435. corresponding model.
  1436. Each <Table> that corresponds to a joint should have one child, an
  1437. <Xfm$Anim_S$> entry named "xform" (this name is a literal keyword
  1438. and must be present). Within this entry, there is a series of up to
  1439. twelve <S$Anim> entries, each with a one-letter name like "x", "y",
  1440. or "z", which define the per-frame x, y, z position of the
  1441. corresponding joint. There is one numeric entry for each frame, and
  1442. all frames represent the same length of time. You can also define
  1443. rotation, scale, and shear. See the full description of
  1444. <Xfm$Anim_S$>, above.
  1445. Within a particular animation bundle, all of the various components
  1446. throughout the various <Tables> should define the same number of
  1447. frames, with the exception that if any of them define exactly one
  1448. frame value, that value is understood to be replicated the
  1449. appropriate number of times to match the number of frames defined by
  1450. other components.
  1451. (Note that you may alternatively define an animation table with an
  1452. <Xfm$Anim> entry, which defines all of the individual components in
  1453. one big matrix instead of individually. See the full description
  1454. above.)
  1455. Each joint defines its frame rate independently, with an "fps"
  1456. scalar. This determines the number of frames per second for the
  1457. frame data within this table. Typically, all joints have the same
  1458. frame rate, but it is possible for different joints to animate at
  1459. different speeds.
  1460. Each joint also defines the order in which its components should be
  1461. composed to determine the complete transform matrix, with an "order"
  1462. scalar. This is described in more detail above.
  1463. If any of the vertices in the model have morphs, the top-level
  1464. <Table> should also include a <Table> named "morph" (this name is
  1465. also a literal keyword). This table in turn contains a list of
  1466. <S$Anim> entries, one for each named morph description. Each table
  1467. contains a list of numeric values, one per frame; as with the joint
  1468. data, there should be the same number of numeric values in all
  1469. tables, with the exception that just one value is understood to mean
  1470. hold that value through the entire animation.
  1471. The "morph" table may be omitted if there are no morphs defined in
  1472. the model.
  1473. There should be a separate <Bundle> definition for each different
  1474. animation. The <Bundle> name should match the CHARACTER_NAME used
  1475. for the model, above. Typically each bundle is stored in a separate
  1476. egg file, but it is also possible to store multiple different
  1477. animation bundles within the same egg file. If you do this, you may
  1478. violate the CHARACTER_NAME rule, and give each bundle a different
  1479. name; this will become the name of the animation in the Actor
  1480. interface.
  1481. Although animations and models are typically stored in separate egg
  1482. files, it is possible to store them together in one large egg file.
  1483. The Actor interface will then make available all of the animations
  1484. it finds within the egg file, by bundle name.