User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
modeleditor:howtos [2012-01-30 11:44]
Carsten created
modeleditor:howtos [2013-01-07 12:07] (current)
Line 1: Line 1:
 ====== How-Tos ====== ====== How-Tos ======
  
-FIXME  This page is still under construction! +===== How do I ... =====
-See http://trac.cafu.de/​ticket/​80 for details.+
  
 +==== ... get my model into Cafu? ====
 +
 +<​HTML>​
 +<div style="​text-align:​ center; clear: both;">​
 +
 +<object style="​height:​ 570px; width: 720px">​
 +<param name="​movie"​ value="​http://​www.youtube.com/​v/​Q3KJm-Ph_5o?​version=3&​feature=player_detailpage&​hd=1&​rel=0"></​param>​
 +<param name="​allowFullScreen"​ value="​true"></​param>​
 +<param name="​allowScriptAccess"​ value="​always"></​param>​
 +<embed src="​http://​www.youtube.com/​v/​Q3KJm-Ph_5o?​version=3&​feature=player_detailpage&​hd=1&​rel=0"​ type="​application/​x-shockwave-flash"​ allowfullscreen="​true"​ allowScriptAccess="​always"​ width="​720"​ height="​540"></​embed>​
 +</​object>​
 +
 +</​div>​
 +</​HTML>​
 +\\
 +
 +Additional notes:
 +  * When watching the video, change the playback quality to "720p HD" if possible.
 +  * There is no audio track in this video.
 +  * Use the [[:​mapping:​cawe:​editingtools:​newentity|New Entity]] tool for placing the newly created ''​.cmdl''​ model into a map. Watch the [[http://​www.cafu.de/​flash/​Placing_a_Model.htm|Placing a Model]] tutorial for related information.
 +  * If you want to make adjustments later, both the ''​.cmdl''​ model as well as the material definitions can be edited as shown above also //after// the model has been placed into a map or world file. The changes will take effect when the program is next restarted.
 +  * In the video, why did we //close// the model window before editing the material definitions?​\\ When you save a model file, the Model Editor //​overwrites//​ the ''​_editor.cmat''​ file as explained at [[modeleditor:​modelfiles]]. In fact, we should never have hand-edited the ''​_editor.cmat''​ file, but do all edits in ''​.cmat''​ (without the ''​_editor''​ part) instead, but we thought it's too difficult to explain that in the video. ​ ;-) \\ Additionally,​ the Model Editor had to re-read the new material definitions anyway, so even if our edits were made in the right file, we had to close and reopen the model.
  
-===== How do I ... ===== 
  
 ==== ... scale my model? ==== ==== ... scale my model? ====
  
-Two methods: +There are two main methods ​for scaling a model: 
-  * via the Skeleton / Joints+ 
 +  * via the Skeleton / the Joint Inspector
   * via the Transform dialog   * via the Transform dialog
 +
 +The [[modeleditor:​skeleton|Joint Inspector]] can transform individual joints of the model, but only for the //bind pose//. It is mostly useful for static, non-animated models, but even then only if there is a special requirement that the Transform dialog cannot handle.
 +
 +The [[modeleditor:​transform|Transform dialog]] is much easier to use, as it transforms the entire model (the whole skeleton): the transformation is applied to all currently selected animation sequences. If no animation sequence is selected at all, the “bind pose” is transformed.
  
  
 ==== ... import animations from other models? ==== ==== ... import animations from other models? ====
  
-Specifically `md5anim` can be imported. +In some cases, importing animations is very easyUse the "**+**" button in the [[modeleditor:​animations]] pane as demonstrated in the above video. 
-Other elements: see next howto: "​... ​share and re-use"+ 
 +However, this works only if the animations are stored in separate files that are compatible with the already loaded meshThis is specifically the case with ''​md5anim''​s for their related ''​md5mesh''​ file. 
 + 
 +We will extend this functionality in the future. Until then and for all other cases, see the next How-To about generically sharing ​and re-using elements.
  
  
 ==== ... share and re-use animations, skins etc. from other models? ==== ==== ... share and re-use animations, skins etc. from other models? ====
  
-Edit the model file, which is a script. +Creating variants of a model by sharing or re-using elements of another model is a straightforward idea, but generally not easy to implement: For example, it's easy to share meshes and animations when the skeleton is an exact match, but much harder to do otherwise. 
-[...]+ 
 +The solution is to manually edit the ''​cmdl'' ​model file, which is a Lua script ​as documented at [[modeleditor:​modelfiles]]
 + 
 +For example, copying and pasting the definition of an animation from one player model into another (that has a compatible, matching skeleton), tends to work very well. 
 + 
 +It is also possible to use Lua's ''​dofile()''​ statement to include models into each other, which we intent to augment in the future to load globals from one model file into a table of another, as to keep the global namespace of the current model clean. 
 +All variants of such file inclusion however suffer the problem that it creates a dependency of one file on anotherThis may be exactly what you want, or maybe not -- where in the latter case falling back to copy and paste is probably the better solution. 
modeleditor/howtos.1327920274.txt.gz · Last modified: 2013-01-07 12:07 (external edit)