Update animesh size by manual edit and script
tracked
Rohacan Hirons
Currently we can't update animesh size and have to upload multiple versions of the mesh in different sizes, and upload all animations for each size.
I did some research in the viewer's code, and it appears to me that it's extremely easy to add a feature to adjust the global size of an animesh by modifying the llcontrolavatar.cpp file. Here is the current setGlobalScale() function:
void LLControlAvatar::setGlobalScale(F32 scale)
{
if (scale <= 0.0)
{
LL_WARNS() << "invalid global scale " << scale << LL_ENDL;
return;
}
if (scale != mGlobalScale)
{
F32 adjust_scale = scale/mGlobalScale;
LL_INFOS() << "scale " << scale << " adjustment " << adjust_scale << LL_ENDL;
// should we be scaling from the pelvis or the root?
recursiveScaleJoint(mPelvisp,adjust_scale);
mGlobalScale = scale;
}
}
And here is a modified version that currently takes into account the X size of the main prim:
void LLControlAvatar::setGlobalScale(F32 scale)
{
if (scale <= 0.0)
{
LL_WARNS() << "invalid global scale " << scale << LL_ENDL;
return;
}
scale *= mRootVolp->getScale().mV[0];
if (scale != mGlobalScale)
{
F32 adjust_scale = scale/mGlobalScale;
LL_INFOS() << "scale " << scale << " adjustment " << adjust_scale << LL_ENDL;
recursiveScaleJoint(mRoot,adjust_scale);
mGlobalScale = scale;
}
}
Note that I replaced mPelvisp by mRoot because using mPelvisp does not correctly adjust the animesh's movement during the animation."
It works wonderfully. Of course, this modification as it stands could affect many existing animesh objects, so we need to add a parameter to the object, 'ANIMESH_SCALE_FACTOR', which would be set to 1 by default, adjustable via script and by manual editing of the object. We would then have something like this:
scale *= mRootVolp->getAnimeshScaleFactor;
Here is a gif, you can take a look, the 4 dogs are all the exact same animesh, I only changed there main prim X scale :
Log In
Shakeno Tomsen
Any updates on this? It's a little odd to see pure silence on this request, even after a resident themselves did all the research work on their own, and even provided a solution. This would make making things like animesh tails, wings and so on so much easier for both the maker and the customer, as we wouldn't depend anymore on having to scale the base mesh itself...
Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
Lucia Nightfire
While we're at it, can we please complete Project Muscadine?
Rohacan Hirons
Lucia Nightfire Hi, sure it would be nice but requires so much work... https://gyazo.com/391749da4df3494f4e0c4615ac54fe37
marxman1313 Resident
Lucia Nightfire What is Project Muscadine...if I should ask. Is it the example provided below of attaching objects to animesh models?
Rohacan Hirons
marxman1313 Resident I don't remember everything, it was about five years ago. We wanted more features for animeshes, like the ability to resize them, offset the skeleton, attach items, and so on. I'm not sure, but I think the new LI calculation rules for all meshes were part of that project as well. Essentially, the idea was to apply the same rules as animeshes to all other meshes, but without the 15 LI for the skeleton. This would have allowed creators to change the way they design their meshes in the future, with the goal of optimizing them and making meshes less resource-intensive.
Lucia Nightfire
marxman1313 Resident
Body shape slider support, body physics slider support, unrigged child prim binding to attach point support. 2 out of 3 were completed before the project viewer was shuttered.
marxman1313 Resident
Rohacan Hirons So pretty much a complete upgrade to the system. Damn.
marxman1313 Resident
Lucia Nightfire As in adding slider support or? If we have a body physics slider I'd love to know where it is.