Unconventional uses of Scalers: repositioning and flipping

Help and Tips on Particles, Scalers, Flash Widgits
Post Reply
DimitriX89
Sage Pixel
Posts: 18
Joined: Fri Mar 10, 2017 4:01 am

Unconventional uses of Scalers: repositioning and flipping

Post by DimitriX89 » Mon Oct 23, 2017 1:24 pm

(Note: if you are unfamiliar with scalers, better read old topics on scalers like this one: http://www.imvu.com/catalog/modules.php ... p=10519256 before they got deleted. Plus, more generalised info about how Scalers and Debug panel editing work: viewtopic.php?f=17&t=262). First use I came with is "repositioning" accessoires or bones without visually scaling them. Since scaler affects relative offset between its bone and the next bone in hierarchy, we can then write the second scaler for this next bone, which will neutralise scaling, but keep the changes in offset.
I'll use the pet product made from repurposed Kitsune avatar as an example
Image
As you can see, it has a bone inserted between root (Female03MasterRoot since originally it was an avatar) and the rest of the bones, called RotationExtra. RotationExtra was moved to the right creating an offset. In order to create scalers for accessoires you'll have to know their bone names. You can contact the original creator of the accessory, or try to guess the names yourself if the first option isnt available. Some tips on the possible naming: accessoires made in 3ds Max usually contain "AttachmentRoot" bone as the root of their hierarchy, and the next bone called "AttachmentNode" (though AttachmentNode may not have anything meaningful connected to it. The default bone name in 3ds max is "Bone", and the naming convention for te new bones will be "Bone01","Bone02" and following. Provided the creator is lazy, they may not rename them at all. In Blender, there is no AttachmentRoot (usually), the default bone name is the same as in Max, and additional bone numbering will start from "Bone.001" (take note of the dot and two zeroes).

Lets try to change the position first, and write two scalers, for Female03MasterRoot and RotationExtra accordingly
Image
Assume we'll need to move it half of the distance closer. So we scale Female03MasterRoot to 0.5,0.5,0.5
Image
As expected, even with distance decreased, the character shrank too. We'll fix it in the next step
Image
by scaling the next bone (RotationExtra) to 2 by all axes and neutralising the scaling from the parent. This effect, obviously, only work if the bones in question have nonzero distance between them. If the offset on one of the axes is 0, then result of any scaling will be 0 as well. If the accessory has some animations that require precise distance between it and avatar, they will be broken, but for simple accessoires it hould be just fine

The next use Scalers can have is mirroring objects. From the 3d program's standpoint, mirroring amounts to scaling to negative value against one of the axes. However in IMVU it is little trickier than that. If we'd need to mirror the accessory in question, first we'll need to determine the correct mirroring axis
Image
Ouch! for some reason X is incorrect. After few tests, Z proven to be needed one
Image
Still looks painful but we're on the right track. What happened is the animation file trying to put joints back to their correct places. Another negative scaler on RotationExtra will fix it
Image
Almost there, but the surface normals are flipped since mirroring only affects vertices position but doensnt recalculate normals
Image
Setting materials to 2-sided fixes that.
Proof of concept product: www.imvu.com/shop/product.php?products_id=39305563 Can be seen as self promotion but I think its better than datamining someone else's mesh

Post Reply