Replies: 19 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Yes, for the blendshape, it's adding a mode (for now I made it with an extra component) that sync all blendshape with the same name on both SkinnedMeshRenderer. I know it will not work for viseme related stuff, but it is needed for example for the Face Tracking Debug object. |
Beta Was this translation helpful? Give feedback.
-
Since there’s already a blendshape sync component, it’s probably best to extend that with a new sync-all mode rather than adding a new similar component… |
Beta Was this translation helpful? Give feedback.
-
Yup, definitely, since the way I'm doing it right now is through replicating your component but with a different rebind logic, it should be pretty easy to just integrate that in the existing one, and change the editor to only display the settings depending on the mode. |
Beta Was this translation helpful? Give feedback.
-
So I have the editor & modified component working. |
Beta Was this translation helpful? Give feedback.
-
Controls should generally describe what they do - so it should be a "Sync all blendshapes" checkbox, not a mysterious "simple mode". |
Beta Was this translation helpful? Give feedback.
-
Would that match what you have in mind for that feature? If we're on the same page, I'll do a PR once I made a couple of extra tests at home (want to test a couple of edge cases and probably provide a way to detect the in prefab editing for asset maker). |
Beta Was this translation helpful? Give feedback.
-
For source renderer please use an |
Beta Was this translation helpful? Give feedback.
-
Idea is also to provide a solution that would allow people to distribute pre-configured prefab, without avatar (like the Face Tracking one for example). |
Beta Was this translation helpful? Give feedback.
-
Yes, that's the idea behind AvatarObjectReference - it binds to a path, but it also does a bunch of UI tricks to make it work more smoothly. |
Beta Was this translation helpful? Give feedback.
-
So I did try to replace the String with an AvatarObjectReference, it does not allow to get the path written manually. Under the hood, my code does use this type once the proper SkinnedMeshRenderer has been found var AvatarRoot = RuntimeUtil.FindAvatarTransformInParents(this.transform);
if (AvatarRoot == null) return;
var renderers = AvatarRoot.gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
if (renderers.Length == 0)
{
throw new ArgumentException("No skinned mesh renderer found");
}
this.sourceRenderer = null;
foreach (SkinnedMeshRenderer renderer in renderers)
{
GameObject gameObject = renderer.gameObject;
if (gameObject.name.Equals(this.SourceRendererName))
{
this.sourceRenderer = renderer;
break;
}
if (this.sourceRenderer == null)
{
throw new ArgumentException("Can't find a Skinned Mesh with name " + this.SourceRendererName);
}
}
var sourceCount = this.sourceRenderer.sharedMesh.blendShapeCount;
var targetCount = localRenderer.sharedMesh.blendShapeCount;
// creating the AvatarObjectReference object
var sourceReference = new AvatarObjectReference();
sourceReference.Set(this.sourceRenderer.gameObject);
GameObject Test = sourceReference.Get(this.sourceRenderer);
if (Test != this.sourceRenderer.gameObject) return;
for (int i = 0; i < sourceCount; i++)
{
for (int j = 0; j < targetCount; j++)
{
if (this.sourceRenderer.sharedMesh.GetBlendShapeName(i).Equals(localRenderer.sharedMesh.GetBlendShapeName(j)))
{
_editorBindings.Add(new EditorBlendshapeBinding()
{
TargetMesh = this.sourceRenderer,
RemoteBlendshapeIndex = i,
LocalBlendshapeIndex = j
});
Bindings.Add(new BlendshapeBinding()
{
ReferenceMesh = sourceReference,
Blendshape = this.sourceRenderer.sharedMesh.GetBlendShapeName(i),
LocalBlendshape = this.sourceRenderer.sharedMesh.GetBlendShapeName(i)
});
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Generally you’d put an AvatarObjectReference in your component as a serialized field, there’s not much point creating it at runtime… |
Beta Was this translation helpful? Give feedback.
-
example of use in a component |
Beta Was this translation helpful? Give feedback.
-
The problem with using AvatarObjectReference is that it does not work properly when you're working on your prefab in the prefab editor, it needs to be in an avatar context with the valid path to the object. You can see on the screenshots that all references are disappearing because of that invalid path, despite being properly in the object when I drag'n'drop the prefab on an avatar. |
Beta Was this translation helpful? Give feedback.
-
Your screenshots look like the references are there…? I think it’s important for MA components to be consistent with each other, which is why I’m resistant to the idea of a bespoke way of referencing an object here. What’s the specific workflow you’re envisioning here? |
Beta Was this translation helpful? Give feedback.
-
Converting to discussion as there’s too many things mixed up in one thread for an issue |
Beta Was this translation helpful? Give feedback.
-
I'm trying to convert the Face Tracking VRCF prefabs in MA prefabs. And I'm trying to replicate the way it can be installed on Avatar, with minimal End User interactions. The way it's currently done through VRCF, is, you take the prefab, drop it on your Avatar, hit the build button, and it works, you don't need to configure anything on any of the components of the prefab. To achieve that, it's using String paths to reference target objects, and it will find said object on Runtime, that way it can minimize the end user interaction with the prefab (when I remember some of the support request I got in my previous jobs, I can totally understand why you'd want to minimize end user operations to the strict minimum if possible). So being able to check that the prefab you're building is correct, and has all the correct references, outside of a scene, before packaging it/pushing it to Github feels like something that needs to be done. |
Beta Was this translation helpful? Give feedback.
-
So, that sounds like what AvatarObjectReference does - it stores a path from the avatar root, and uses that to locate a target object. I'm just a bit confused about what part of your workflow isn't working - it sounds like maybe there's some UI/UX issues with the AOR editor, in which case we should just fix that. |
Beta Was this translation helpful? Give feedback.
-
Here's a blendshape sync (using AOR for the mesh) in isolation mode. We could change the property drawer to allow the mesh path to be edited when outside of an avatar. (I also note that the + button breaks when outside of an avatar, which probably should be fixed) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying to convert Face Tracking prefabs to MA, as for a lot of reasons I don't want to use VRCFury, I could do the installation manually, but it gets old really fast, and let's be honest here, drag'n'drop the prefab on the avatar is still a lot more comfortable.
To that end, and for other projects I'm in the process of creating a couple of MA components that are needed:
Blendshape syncer: gets a string as input for the source/remote SkinnedMeshRenderer, and sync all the weight with the local SkinnedMeshRenderer (already have that one working, just haven't done an editor the way you're doing it yet),
Parameters Installer: gets a parameter asset file as input, and installs all the parameters as they are specified (I kinda think you're already working on that one according to issues I've read, but automated translation being what they are, I'm not entirely sure),
Would you welcome those features?
Beta Was this translation helpful? Give feedback.
All reactions