AnyPortrait > Manual > Non-Uniform Scale option

Non-Uniform Scale option


1.2.5



As in the image above, it seems simple to make the size of the characters increase in the X or Y axis, but surprisingly, this is a function not supported by AnyPortrait.
Position, rotation and scaling in AnyPortrait's system are designed differently from that of Unity.
This method has the advantage that the scale of a series of bones is not distorted and changes, but on the contrary, there is a limitation in making Non-Uniform Transformation as above.


However, limited non-uniform scaling is possible through the option added in AnyPortrait v1.2.5.
With this option, this page covers how to change the "scale of all rigged with bones of the character".




Scaling in Unity




This is the most recommended method.
(1) Create a new empty GameObject that will be the parent.
(2) Register as a child of the GameObject created in (1) with the character created with AnyPortrait.
Afterwards, you can change the position, rotation, and size by controlling the Transform of the Parent GameObject.


This method is the most reliable and should be applied, especially if it is linked to Mecanim or Timeline.




Controlling character scale inside AnyPortrait


Next, let's look at how to control the size of a character entirely inside AnyPortrait.
When rigged, the first thing that comes to mind as a way to control the overall size is to resize the "Root bone".
This method is mostly valid in other engines or other tools.
Let's change the size of the "Root bone" once.




The character above has one Root bone.
Let's increase the scale X of the Root bone.




When you increase the X of Root bone, you would generally expect the same result as the image in (1).
However, in AnyPortrait, you will see results like (2) or completely different results for the following reasons.


Why the results are different than expected
1. The bone scale works only as the "Local coordinate system".
2. The characteristic of AnyPortrait is that the increase or decrease of the child bone size is operated only in the "Local coordinate system". Therefore, the direction of increasing or decreasing the size of the parent bone and the direction of increasing or decreasing the size of the child bone are independent of each other.


In particular, 2 has the advantage of reducing the distortion of the child bones even if the scale of the parent bone is changed as non-uniform.
But, on the other hand, it's a problem if you want to resize like above.


Since the way to control the size of the "root bone" was not valid, you could try to fix this by creating a separate "child mesh group".






Let's make an existing character included in "child mesh group".
(1) Click the Add Mesh Group button and (2) create a New Parent Mesh Group.




(1) Select the newly created Parent mesh group.
(2) Set as Root Unit.




(1) Select "Previous character root unit".
(2) Click the Unregist Root Unit button to release the root unit.
Now only the newly created empty mesh group will be registered as 1 root unit.




(1) Select Parent mesh group again.
Currently, this mesh group is empty.
Let's register an existing character as a child of this mesh group.
(2) Click the "+" button.
(3) Select the Mesh Group tab.
(4) Select an existing character mesh group.
(5) Click the Add button and (6) click the OK button in the guidance message.




(1) As shown in the image above, the existing character has been included as a child mesh group.
Most of the existing data works normally, but animation works only in "Mesh groups registered as Root units".
So, you need to change the mesh group attached to the animation.
(2) Select the animation clip and click the Change button, and then change the connection information to the new parent mesh group.
(Refer to the related page for a detailed explanation of this process.)




You can now control the position, rotation, and scale of your character with the mesh group.
With the Transform or Morph Timeline Layer selected,
(1) Select the Child Mesh Group that is an existing character.
(2) Register as a timeline layer.




(1) Add a keyframe.
(2) Increase the scale of the child mesh group along the X axis.
It is expected that the same result as (3) will come out, but unfortunately, the size has changed to a somewhat strange shape.
It's even different from changing the scale of the "Root bone" we tested above.
This is because AnyPortrait's system behaves differently from the user's intention because the scailing method between "child mesh group" and "root bone".


However, you can solve this issue by using the option added in v1.2.5.




(1) Open the Setting dialog
(2) In the Portrait tab, change the value of Scale of Root Bone to Non-Uniform Scale.




Alternatively, you can change the option as well.
(1) Open the Bake dialog and (2) select the Setting tab.
(3) Likewise, change the Scale of Root Bone option to Non-Uniform Scale.




When you come back to the workspace, you can see that the scale of the character is now working properly.




When you run Bake and check it in the game, you can also see the size change as you intended.


Caution
Although this description covers the process of converting an existing character to a child mesh group, this method is not recommended as the modifiers are created in the child mesh group rather than the parent mesh group.
Instead, it is best to create and edit Modifiers in Parent Mesh Group while Child Mesh Group has been created from scratch.




About Non-Uniform Scale Option


The Non-Uniform Scale option introduced above applies only to the relationship between the "Child Mesh Group" and its "Root bone".
Unlike the existing AnyPortrait system, this option allows limited scaling.
Otherwise, it does not apply to Root bones of a Root Mesh Group, Child Mesh Groups without bones, or Non-rigged Meshes.


The difference between the default method and the Non-Uniform Scale method is compared as follows.




This is the default method.
The image above shows the scale applied to the "Root Bone".
When the X-axis scale of the Root Bone increases, the size of the bone's "Thickness" increases, not the scale of the X-axis as a whole.
In the same way, as the Y-axis scale of the Root bone increases, the "Length" of the bones increases, which is a feature of this system.
If the scale is reversed along the X or Y axis, the entire scale is reversed based on the direction of the Root Bone.




This is the result of turning on the Non-Uniform Scale option and scale to "Child Mesh Group" with bones.
As the X-axis scale of the Child Mesh Group increases, the bones and meshes as a whole increase to Left and Right,
When the Y-axis scale of the Child Mesh Group increases, the bones and meshes as a whole are stretched Up and Down.
If you reverse the scale, you can see that the scale is reversed along the X or Y axis based on the Child Mesh Group, rendering the intended result.


At first glance, the Non-Uniform Scale option seems to be able to solve all the problems related to the existing scale method.
There are some problems, so you should only use this option when absolutely necessary.