Jump to content

[QUESTION] How to Scale Animated Actors?


Splizard
 Share

Recommended Posts

I am trying to figure out how to change the scale of an animated actor. It doesn't appear to be a moddable feature, so I have been modifying the .dae files in order to attempt to accomplish this.

For static actors (such as buildings), the scale can be adjusted either by adjusting the scale tag in the Collada file.

        <scale sid="scale">1 1 1</scale>

The other option I took was to write a program that manually scales all the vertices of the model and saves this back to the .dae model.
Unfortunately, both of these options did not work for scaling animated actors whose proportions were all messed up... (Big or Small)0ad.thumb.png.cef9f9b20ff6bba7cfb1d9eadd41ee26.png

I am not so familiar with Collada or how animations are stored. Could anyone point me in the right direction on how to accomplish something like this? (do I need to scale the armatures/transformations/weights etc) Blender did not work very well for me either...
I am really looking for a way to automate this, as I would like to create an actor editor for 0ad with this kind of feature. Thanks!

  • Like 3
Link to comment
Share on other sites

1 hour ago, stanislas69 said:

Maybe the scale modifiier is not 1.1.1 for all meshes ?

Changing the scale ratios does have an effect to some extent, however, it does not appear to resolve the proportion issue (I'm not talking to about the head though, which is a separate actor which I have not scaled). The model is scaled to the correct height but it seems like everything is stretched when made taller and everything is squashed when made smaller.

Link to comment
Share on other sites

15 minutes ago, Splizard said:

Changing the scale ratios does have an effect to some extent, however, it does not appear to resolve the proportion issue (I'm not talking to about the head though, which is a separate actor which I have not scaled). The model is scaled to the correct height but it seems like everything is stretched when made taller and everything is squashed when made smaller.

Could you share your script ? Maybe the way the coordinates are scripted makes them relative to the scale factor, hence giving you the strange effects.

Link to comment
Share on other sites

11 minutes ago, stanislas69 said:

Could you share your script ? Maybe the way the coordinates are scripted makes them relative to the scale factor, hence giving you the strange effects.

So I have currently modified the scale tags in a few of the female citizen models.
https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/art/animation/biped/new/fem_walk_relax.dae
https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/art/meshes/skeletal/new/f_dress.dae

I have played around with the values (eg. all being the same value, or trying different values). The snippets are below.

fem_walk_relax.dae
<node id="Armature" name="Armature" type="NODE">
  	...
      <scale sid="scale">0.75 0.01 0.5</scale>

<node id="m_armor_tunic_short" name="m_armor_tunic_short" type="NODE">
  	...
      <scale sid="scale">0.1 0.01 0.5</scale>
  
 f_dress.dae:
<node id="f_dress" name="f_dress" type="NODE">
	...
      <scale sid="scale">0.1 0.25 0.5</scale>
    
<node id="Armature" name="Armature" type="NODE">
   	...
      <scale sid="scale">0.1 0.25 0.5</scale>

As far as a script goes, it simply multiplies every number in the "mesh-positions-array" with the scaling factor and then saves the file again.

This may be the wrong way to go about it, however, it has worked with static meshes.

Link to comment
Share on other sites

Scaling for 3D models has to be done around a reference point. Since models aren't spheres they may have odd types of symmetry so a naive scaling algorithm is certain to fail. I'd suggest using a program specifically designed for working with 3D models to do the scaling with, like wings3D or blender. Those programs have better facilities for managing scaling to make it easier and to allow you to see what you're doing.

  • Like 1
Link to comment
Share on other sites

15 minutes ago, aeonios said:

I'd suggest using a program specifically designed for working with 3D models to do the scaling with, like wings3D or blender.

I remember the editor of Warcraft III allowing you to scale animated units though. There was a parameter you could set like "scale", just one number, and the corresponding unit would be scalled correctly in proportion.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

It would be fantastic if anyone who is familiar with the 0ad Modelling process were to provide me with a working .dae model of one of the "Athenian Citizen" animations scaled exactly in half. With this reference, I should be able to reverse engineer a programmable way of scaling the animation! 

Link to comment
Share on other sites

3 minutes ago, Splizard said:

It would be fantastic if anyone who is familiar with the 0ad Modelling process were to provide me with a working .dae model of one of the "Athenian Citizen" animations scaled exactly in half. With this reference, I should be able to reverse engineer a programmable way of scaling the animation! 

@stanislas69

Link to comment
Share on other sites

26 minutes ago, Splizard said:

It would be fantastic if anyone who is familiar with the 0ad Modelling process were to provide me with a working .dae model of one of the "Athenian Citizen" animations scaled exactly in half. With this reference, I should be able to reverse engineer a programmable way of scaling the animation! 

Could do for one of two but more would be too much work. There are more than 50 anims.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...