Search Unity

Skinn Pro & Free - Skin & Blendshape Projection + Much More

Discussion in 'Assets and Asset Store' started by cwmanley, Feb 15, 2017.

  1. petersx

    petersx

    Joined:
    Mar 5, 2015
    Posts:
    239
    Thanks, this solve the problem :)
     
    cwmanley likes this.
  2. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Hi @cwmanley
    Very much enjoying using your asset. I'm using the current version on itch.io in both Unity 2018.4 and 2019.3.

    I'm using the TextFilter (Shapes > Edit Names) and trying to use that to remap Mixamo blendshape names to iPhone blendshapes.

    The problem is that on certain shapes, Mixamo uses two (left/right) instead of the iPhone's one.
    e.g.
    MouthNarrow_Left = shapes.mouthFunnel
    MouthNarrow_Right = shapes.mouthFunnel

    After running the filter, what I get is only the first of the two blendshapes. So in the above example, MouthNarrow_Left does become shapes.mouthFunnel, but altering the value of shapes.mouthFunnel doesn't affect the vertices in MouthNarrow_Right.
    See:


    I also ran into a few problems as I've been using Skinn, which you can see in the full length workflow video I did. It seems that the Edit names editor window doesn't always seem to update correctly:


    And finally (sorry, so many questions!) I couldn't work out quite how to use the Text Filter.

    When i tried using the functions.
    e.g.
    replaceText(Blink_Left, shapes.eyeBlink_L)
    replaceText(Blink_Right, shapes.eyeBlink_R)
    replaceText(BrowsDown_Left, shapes.browDown_L)
    etc.
    Only the first one has any effect, the other blendshape names remain unaffected. (which is why I ended up doing everything in ****Flagged Elements**** ).

    Can you explain how it's meant to work? I couldn't find any documentation on it anywhere.
    Thanks!
     
  3. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi, Thanks for your purchase.

    1. "MouthNarrow_Left does become shapes.mouthFunnel, but altering the value of shapes.mouthFunnel doesn't affect the vertices in MouthNarrow_Right"

    Due to Unity's API for blend-shapes shapes should have a unique name. The TextFilter does not combine shapes with the same name but I will look at adding that feature.

    Right now the only way to combine shapes...
    1. Install a package to paste a mesh as a blend-shape. package here
    2. Set shapes that are combined to 100%.
    3. SkinnEdit/Skin/BakeTo Mesh Renderer
    4. Use the Clipboard/Paste//Mesh As Blend-shape
    The Paste//Mesh As Blend-shape command will be updated and included in the next version.

    There will also be a new command to combine two blend-shapes into one shape.

    2. "Edit names editor window doesn't always seem to update correctly"

    The problem seems to be that Skinn is not recognizing the skinned mesh as valid because the mesh does not have bone-weights. Not fully supporting skinned meshes with-out bones is a design flaw that I am working on fixing but it looks like it will take a few updates to completely solve the issue. I will add a fix to for the TextFilter asap.

    For a workaround and to make a skinned mesh with-out bones work will all features you can use the SkinToParent Mesh Renderer Command
    1. Assign the mesh with blend-shapes to a Mesh Renderer.
    2. Place the Mesh Renderer as a child.
    3. MeshRender/Skinn: Edit/Skin/Skin To Parent
    4. Organize the new skinned mesh and bone however you see fit.
    Please let me know if your still having issues.

    Thanks,
    Chris
     
  4. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Thanks Chris ( @cwmanley )
    That's all really helpful.

    Re. #1 Yeah, I gathered as much. I'm actually now looking at doing the process backwards, so rather than trying to alter the destination skinned mesh (and renaming its blendshapes to match the animation clip) I'm looking at doing a search and replace on the clips themselves. Turns out that because they're just text assets (in the YAML format) you can pretty much rename anything you want (i.e. re-target), as well as duplicate animation curves in order to apply them to any blendshape you want.

    Re. #2 Thanks for the heads up. Happy to wait for updates as and when.

    Great tool you've made. Thank you.
     
    cwmanley likes this.
  5. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    ps. you never mentioned about the Text Filter format. What's with the "Functions" and "Flagged Elements"? Any docs to explain how the file should be formatted and used?
     
  6. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    There are not docs yet.

    When you create a text-filter asset with the wizard the settings are applied to the text-filter.


    Example blend-shapes named FBMSkinny, FBMFat

    Functions

    There are two functions you can use. Functions are applied to all elements that are not listed under Flagged Elements.


    The replaceText function is used to rename blend-shapes.

    Code (CSharp):
    1.  
    2. ****Functions****
    3. replaceText(FBM, FullBodyMorph)
    4.  
    Resulting names; FullBodyMorphSkinny, FullBodyMorphFat.

    Code (CSharp):
    1.  
    2. ****Functions****
    3. replaceText(FBM, )
    4.  
    Resulting names; Skinny, Fat.

    The containsText function is used to exclude blend-shapes

    Code (CSharp):
    1.  
    2. ****Functions****
    3. containsText(Fat)
    4.  
    Resulting blend-shapes; Skinny

    Flagged Elements
    Similar to the functions there are two uses for flagged elements, but flagged elements work explicitly for the shape flagged.
    Code (CSharp):
    1.  
    2. ****Flagged Elements****
    3. FBMSkinny = BodySkinny
    4. FBMFat
    5.  
    Resulting blend-shapes; BodySkinny.
    FBMSkinny is named to BodySkinny, while is FBMFat is excluded.


    All Elements

    The All Elements section is generated by TextFilter wizard for your reference only.


    Thanks for the great question I will add this to the docs.
     
    wetcircuit likes this.
  7. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    @cwmanley Super helpful. Thank you.

    I'm running into a problem using Skinn in 2018.4.1 (tied to that version for a number of reasons)

    After using Skinn:Edit > SubMesh > Combine > Selection > Merge Shared
    The resulting mesh is generated without any errors and appears to be fine until I change one of the blendshapes and I then get spammed in the console with the following error: 'Thread group size must be above zero'
    There's no additional information from the console:


    The same skinnedMeshes combined in 2019.3.3 don't have that error. Is there any way to solve this?

    I tried exporting as FBX from 2019 and using that in 2018 but when I do that, although it appears to import fine:

    as soon as I use a blendshape the mesh becomes distorted:


    Any help, much appreciated :)
     
  8. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    ps. for info, combining skinned meshes with blendshapes using MeshBaker works fine (no errors), except that it doesn't combine the blendshapes, as Skinn does.
     
  9. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi,

    I cannot reproduce the error with the assets I am using. Can you send me a package with only the model/mesh assets you are using when the error happens? I will try to figure out what is going on today and send you a fix right away.

    Sorry for any inconvenience.
     
    jeromeWork likes this.
  10. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Thank you. Sent to the email in the asset ReadMe
     
  11. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    I will take a look right now. I will not share the asset with anyone and delete it once I figure out what is going on.

    Thanks
     
    jeromeWork likes this.
  12. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    For anyone interested in the outcome of the above issues... @cwmanley has been incredibly helpful. There's a new Skinn update on the way which will fix some known issues, but I'm more of the opinion that the fault lay with the 2018.4.1 version of Unity i was using. After further testing, with 2018.4.16 and 2018.4.18 LTS the problem just disappeared.
     
  13. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ahhh… silly me, I forgot that LTS versions aren't actually final… :rolleyes:
    Screen Shot 2020-03-12 at 8.42.14 AM.png
     
    jeromeWork likes this.
  14. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    yeah! That hub doesn't make it massively obvious... Thankfully I'm all good now, and your models are looking as wonderful as ever :)
     
    cwmanley and wetcircuit like this.
  15. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    I love the Unity Hub! I try to develop features in the newest version of Unity available on the Hub, then work backwards when I do a update. Hopefully when you import Skinn you are not spammed with update warnings, but sometimes those bastards can sneak by me. o_O
     
    wetcircuit likes this.
  16. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Skinn 0.7 Released on UAS and itch.io

    Known Issues
    • The VM does not support boneless skinned meshes as a source. Use the SkinToParent Mesh Renderer Command to create a valid skinned mesh.
    Bug Fixes & Improvements.
    • Vertex Mapper Shape-filter not being update by the inspector. The VM Shape-filter should work as intended.
    • Most commands support boneless skinned mesh renders. Use the SkinToParent Mesh Renderer Command for full support.
    • Blend-shape Normals and Tangents not copied correctly when combining skinned meshes.
    • Bend-shape Normals being lost when baking meshes.
    • SKINN Script Defining Symbol being defined twice.
    • Blend-shape baking supports negative and un-clamped shapes.
    • 32bit index format for meshes over the 16bit index format vertex limit.
    New Components
    • TexturePacker.cs a component based texture atlas tool.
    • BlendshapeController.cs a blend-shape inspector for multiple skinned meshes.
    New Commands
    • Renderer/Clipboard/Paste/Blend-shapes : Pastes blend-shapes from one skinned mesh renderer to another, existing blend-shapes will be skipped
    • Renderer/Clipboard/Paste/Mesh As Blend-shape : Pastes mesh as a blend-shape.
    • Renderer/Clipboard/Paste/VertexData/Vertices : Pastes vertex data from one renderer to another.
    • Renderer/Clipboard/Paste/VertexData/Normals&Tangents : Pastes vertex data from one renderer to another.
    • Renderer/Clipboard/Paste/VertexData/Colors : Pastes vertex data from one renderer to another.
    • Renderer/Clipboard/Paste/VertexData/Colors32 : Pastes vertex data from one renderer to another.
    • Renderer/Clipboard/Paste/VertexData/UVs : Pastes vertex data from one renderer to another.
    • SkinnedMeshRenderer/Bones/Combine Bones : Combine one bone's weights into another bone's weights.
    • SkinnedMeshRenderer/Shapes/Sort : sorts blend-shapes by name
    • SkinnedMeshRenderer/Shapes/Log : Logs the index and name of each blend-shape in a mesh.
    • SkinnedMeshRenderer/Shapes/Extract/Shape : Extracts Blend-shape value at 100% as a mesh
    • SkinnedMeshRenderer/Shapes/Extract/All : Extracts all blend-shapes.
    • SkinnedMeshRenderer/Shapes/Invert : creates a new inverted blend-shape.
    • Renderer/Shapes/Remove/Shape : Removes a blend-shapes from a mesh.
    • Renderer/Shapes/Remove/Data/Vertices/Shape : Removes a blend-shapes vertices from a mesh.
    • Renderer/Shapes/Remove/Data/Vertices/All : Removes all blend-shapes vertices from a mesh.
    • Renderer/Shapes/Remove/Data/Normals/Shape : Removes a blend-shapes normals from a mesh.
    • Renderer/Shapes/Remove/Data/Normals/All : Removes all blend-shapes normals from a mesh.
    • Renderer/Shapes/Remove/Data/Tangents/Shape : Removes a blend-shapes tangents from a mesh.
    • Renderer/Shapes/Remove/Data/Tangents/All : Removes all blend-shapes tangents from a mesh.
    • Renderer/Shapes/Remove/Unused : Remove all unused blend-shapes from a mesh.
    The new atlas tool the Texture Packer has built in instructions, tips, and tool-tips. You can use the standard transform tools, commands and even other assets to manipulate uv islands. Tiled textures are not fully supported yet, and the tool has only been tested with a limited number of models.

    Capture.PNG
    To use the BlendShapeContoller simply add the component to the root of the model and you can edit all the blend-shapes of it's children at once.The component is designed for the editor, however you can use the api at run-time if you wish. The BlendShapeContoller looks for blend-shape changes automatically and has undo support.

    Capture.PNG

    There should be another update very soon. Please let me know if you have any issues.

    Chris
     
    tapawafo, hopeful, AGregori and 2 others like this.
  17. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Awesome update.
    Just a tip: a more 'conventional' pdf (or html) manual would probably be an attractive plus for newcomers.
     
  18. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hello,

    After 2019.3.1 there is a bug on Mac with Skinn's compute shaders. I am going to make the compute functions fallback to C# on platforms that don't support compute shaders and add a option to disable compute shaders all together.

    I will try to get a update out asap and update the free version as well.

    @wetcircuit thanks for all your help with the Mac issue.

    Thanks
     
    JoeStrout and wetcircuit like this.
  19. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi,

    Skinn 0.71 Released on UAS and itch.io

    //Known Issues
    • After 2019.3.1 there is a bug on some Macs with Skinn's compute shaders.
    • The VM does not support boneless skinned meshes as a source. Use the SkinToParent Mesh Renderer Command to create a valid skinned mesh.

    //Fixes
    • !!!Combining Skinned Meshes with blend-shapes created a extra blend-shape frame.
    • VM a bug introduced in 0.7 where you could not Append To New or Apply Addition Smoothing etc.
    • TexturePackerInspector missing a default texture.
    • Nested Context Command System: Built in Material Commands not showing up when the internal asset was not loaded.
    • Made asset easier to use with Assembly Definitions.
    //New Commands
    • Transform/Sort
    • SkinnedMeshRenderer/Shapes/Extract/Current Shape
    • SkinnedMeshRenderer/Shapes/Extract/All

    //New Features
    • The Context Command System can be accessed from hierarchy context menu under Skinn:Edit.

    This is the last update for the 2017.4 LTS the minimum version going forward will be the 2018.4 LTS.

     
    XCO likes this.
  20. rusty_kuntz

    rusty_kuntz

    Joined:
    May 21, 2018
    Posts:
    9
    Hi @cwmanley , Love the Skinn pro and using it all the time.
    I am now trying to run the Vertex Mapper from the API (SkinnEx) but its not creating the new skin mesh, no errors, not sure why.
    Can you guide me how to do it? very broadly of course.
    Thank you
     
    cwmanley likes this.
  21. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi, I am glad your are finding the asset useful.

    Are you using the VertexMap function? The VertexMap function outputs the vertex information only it does not create a renderer. Here is a example of using the VM function to create a skinned mesh renderer.

    Code (CSharp):
    1. private SkinnedMeshRenderer ProjectBlendshapesExample(SkinnedMeshRenderer source, SkinnedMeshRenderer target)
    2. {
    3.     int[] mapping;
    4.     float[] distance;
    5.     Vector3[] vertices;
    6.     Vector3[] normals;
    7.     Vector4[] tangents;
    8.     BoneWeight[] boneWeights;
    9.     Blendshape[] blendshapes;
    10.  
    11.     var shapeOptions = new ShapeProjection();
    12.     var weightOptions = new WeightProjection();
    13.  
    14.     //Change the default radial count from 16 to one for faster projection
    15.     shapeOptions.radialCount = 1;
    16.  
    17.     //Disable weight projection.
    18.     weightOptions.enabled = false;
    19.  
    20.     if (!source.VertexMap(target,
    21.         out mapping,
    22.         out distance,
    23.         out vertices,
    24.         out normals,
    25.         out tangents,
    26.         out boneWeights,
    27.         out blendshapes,
    28.         null,//Source Baking how the source is transformed before mapping
    29.         null,//Target Baking how the target is transformed before mapping
    30.         null,//Search Options the distance to look for vertices.
    31.         weightOptions,
    32.         shapeOptions
    33.         ))
    34.     {
    35.         //Can not compute. or meshes null.
    36.         return null;
    37.     }
    38.  
    39.     //Clone() will Instantiate a new renderer and a new mesh or optionally leave the mesh null.
    40.     var newRenderer = target.CloneAsSkinnedMeshRenderer(false) as SkinnedMeshRenderer;
    41.     var newMesh = newRenderer.sharedMesh;
    42.  
    43.     //Clear all blendshapes or handle existing blend-shapes.
    44.     //Unity's API for adding blends-shapes will throw a error if there is a existing shape with the same name.
    45.     //var existingBlendshapes = newMesh.GetBlendshapes();
    46.     newMesh.ClearBlendShapes();
    47.  
    48.     foreach (var shape in blendshapes)
    49.     {
    50.         for (int i = 0; i < shape.frames.Count; i++)
    51.         {
    52.             newMesh.AddBlendShapeFrame(
    53.                 shape.name,
    54.                 shape.frames[i].frameWeight,
    55.                 shape.frames[i].shapeDeltas,
    56.                     shape.frames[i].shapeNormals,
    57.                     shape.frames[i].shapeTangents
    58.                     );
    59.         }
    60.     }
    61.  
    62.     return newRenderer;
    63. }
    You can take a look at the Vertex Mapper component for a more advanced example of using the VertexMap function.

    Another option is to create a VM component and use one of it's public functions.

    Code (CSharp):
    1. var vm = new GameObject("Temp VM").AddComponent<VertexMapper>();
    2. vm.root = animator.gameObject;
    3. SkinnedMeshRenderer smr;
    4. vm.Create(sourcePrefab, targetPrefab, out smr);
    Please let me know if you need anything else.

    Thanks
     
  22. rusty_kuntz

    rusty_kuntz

    Joined:
    May 21, 2018
    Posts:
    9
    Hi
    Doing it using VertexMap works perfectly and fast,
    Thanks for that and your fast reply! :)
     
    cwmanley likes this.
  23. rusty_kuntz

    rusty_kuntz

    Joined:
    May 21, 2018
    Posts:
    9
    Hi Chris
    I hope everything is good and you are working on some cool asset for us to purchase.
    I am trying out the Texture pucker and it generate a very dark / wrong textures, both for normal and albedo

    Here are couple of images to show you what I mean:
    https://drive.google.com/drive/folders/1gIk_rOihjzOfp1t-aRfsE7JaK9yBBWlI?usp=sharing

    I am sure that I am missing something,
    Project is URP,

    What do you think?
    Thnaks :)
    Or
     
  24. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hello,

    Thank you, sorry I have been so quiet lately.

    The shaders I use to render textures should work in any rendering pipeline but maybe it is not picking up the right textures. I will make sure the Texture Packer is working correctly with the URP/HDRP and look into the issue.

    I recommend saving the mesh with the new uvs and using Gimp/Photoshop to create the atlas textures or use the Texture Packer with the Standard Pipeline.


    0.72 will be out soon.
    • Drag and Drop Merging skinned meshes will be less intrusive with a new contextual drop area.
    • VM will bind-pose existing blend-shapes.
    Generic UMA support.
    • Drag and Drop Merge to Adjust Bones(Transform(s) with the suffix "Adjust").
    • Create Adjust Bone Context Command..

    0.8 is in the works.
    • New mapping algorithms with higher quality weight and shape projection.
    • Mac and Mobile support.
    • Major API and changes .
    • API Documentation.
    • Extensive User Documentation.
    • Many small improvements and new features.

    Thanks
     
    SammmZ, Jaimi, AGregori and 2 others like this.
  25. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Will you be testing 0.8 on 2020.1 before release?
     
  26. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Sorry, noob question: can skinn pro works at runtime from code? I mean, can I for example write a C# script that will delete certain blendshape from skinned mesh?
     
  27. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    0.72+ will supports the LTS releases and 2020 releases.

    Most the editor commands use a runtime api that you can use in your own scripts.

    Code (CSharp):
    1. public static void SkinnEx.RemoveBlendshape(this Mesh mesh, int index)
    2. public static void SkinnEx.RemoveBlendshape(this Mesh mesh, string name)
    3.  
    4. public static void SkinnEx.RemoveBlendshapeData(this Mesh mesh, int index, bool removeVertices, bool removeNormals, bool removeTangents)
    5. public static void SkinnEx.RemoveBlendshapeData(this Mesh mesh, string name, bool removeVertices, bool removeNormals, bool removeTangents)
    Just make sure you clone the mesh before using the functions that work on a mesh directly. Please let me know if you need anything else.
     
    SammmZ and AGregori like this.
  28. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hey all, I've got a seemingly simple problem, and someone pointed me to Skinn as possibly having a solution:

    I have an already-rigged mesh, to which I want to add a handful of extra bones (e.g. so that I can animate the hair or bouncier parts of the anatomy, so they don't appear to be made out of hard plastic when the character moves). I do not want to repaint or reset all the vertex weights for the rest of the bones; I only want to affect limited parts of the mesh where the new bones have been added.

    In my modeling tool (Cheetah3d), much to my surprise, this is impossible. If I add a couple of new bones, I have to rebind the entire mesh (losing the professionally done vertex weights) or it all goes to heck.

    I've skimmed very quickly through this thread, and I see that Skinn has a ton of tools related to meshes and bones, and started out originally as a weight painting tool. So I'm hopeful.

    Can I use Skinn to add a couple of new bones to an existing rig, and paint the weights for just those parts? And if so, how would I do that?
     
  29. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    HI, Thanks for your interest.

    Skinn is mainly for transferring weights and blend-shapes from on mesh to another. I have not included a weight-painting tool yet; although I hope to have excellent one a some point. :(

    I think Vertexmotion would do the trick, I have used it in a few projects.
    https://assetstore.unity.com/packages/tools/animation/vertexmotion-23930

    Sorry I can't help with that right now.
     
    JoeStrout likes this.
  30. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Thanks for your response! I'm sorry, but I don't clearly understand what do you mean by "clone the mesh before"?
     
  31. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    That is my bad.

    Unity's Instantiate.
    Code (CSharp):
    1.  var clone = Mesh.Instantiate(Mesh source);
    Skinn has Clone functions you can use to Instantiate as well if you like.

    Code (CSharp):
    1.  
    2.  
    3. /// work with a Mesh Render or a SkinnedMeshRenderer
    4.  var renderer = GetComponent<Renderer>();
    5.  var newMesh = renderer.CloneSharedMesh();
    6.  
    7. //edit Mesh Here
    8. //newMesh.ClearBlendShapes();
    9.  
    10. renderer.SetSharedMesh(newMesh);
    11.  
    12.  
    Instantiating a mesh assigns a new InstanceID which will force the SkinnedMeshRenderer to update it's data when the new mesh is assigned.
     
  32. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    Great! Thanks for the detailed explanation!
     
  33. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Thanks to cwmanley for explaining how to transfer my custom iPhone blend shapes to my Fuse figures (I thought I needed to bake the FACS blend shapes in Wrap3 for each character, and then import them to Unity to load on my figures 1-by-1… But, omg it's so much easier)!

    New Skinn Pro tutorial: Extract, Load, and Transfer Blend Shapes



    video starts with a trick in Adobe Fuse to export all Fuse figures with a consistent body mesh vertex order

    HOW TO
    13:15 Extract Blend Shapes
    16:48 Load Blend Shapes with the Blend Shape Wizard
    21:50 Transfer blend shapes between similar topology
     
    Last edited: Aug 1, 2020
    AGregori, cwmanley, hopeful and 3 others like this.
  34. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey CW, haven't used Skinn in a while and I'm trying to do something new with it... edit a UMA mesh/slot by moving and scaling it slightly to make some helmets fit better (not a base mesh of a race, just an equipment piece). Is UMA stuff in the current version? I see above that there's "generic UMA support" in .72. Is there anything in the current version for editing UMA meshes/slots? I'm assuming I should edit the original skinned mesh and then rebuild the slot? Didn't Skinn have UMA specific commands in an earlier version, or am I remembering that wrong?

    Also, could we get an early version of the docs? It feels like the interface changes frequently and even incomplete docs would be better than nothing. Have you thought about doing it as a wiki? I'd add to it :)

    Thanks for your time!
     
    Duffer123 likes this.
  35. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi,

    I am behind a bit on development. I started a new job that I am still getting used to sorry for the delay.

    Skinn had some UMA specific commands for the Delta Canvas. The Delta Canvas will come back at some point. I might make a editor script to support dragging UMA Sots into the hierarchy and converting them back into skinned meshes. I will see if the UMA folks are interested in adding the feature to UMA or else I will add it Skinn Pro. I think UMA had a fork started to convert slots to meshes so it should be pretty simple. For right now you need to use the source asset or a prefab that gets generated by the UMA Slot Builder.

    To apply changes you make with bones you can use Drag and Drop Merging Bind-pose Feature.
    1. Scale the source skinned mesh and create a prefab new prefab called "Scaled Prefab" or whatever you want.
    2. Remove the Scaled Prefab from the scene.
    3. Place the unscaled source in the scene.
    4. Drag the Scaled Prefab onto the source's root Transform in the hierarchy and select "Merge Bind-posed" when prompted.
    5. Save the new mesh and or create a new UMA Slot.
    I am working on a high quality example model to include and to illustrate the new documentation. Right now the new documentation and api would not be very useful in it's current form, but that is my main priority when I can get back to it and I will share it as soon as I can. Having a wiki user could edit would be great, I will add that to the front of my TO-DO list.

    Thanks,
    Chris
     
    wetcircuit likes this.
  36. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Is there any way the community could make Skinn more profitable for you? I mean it's a game changer for its targeted niche: you should be able to make good money off of it.
     
    Alic and wetcircuit like this.
  37. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi, Thanks

    @wetcircuit is legend!

    I am happy to work on a project that is so useful to long time and new users, profitability be damned.

    The new job/career is going great
     
  38. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @cwmanley , @wetcircuit just wondering whether I can use my Skinn Pro to add a body blendshape to (CC3) model A in the form and from model B, where both fbx models share same uv and rig but say model A is neutral but model B is fat, so you effectively add a GetFat blendhape to model A.?

    I hope you get what I'm getting at there?
     
  39. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    I was confused by this too…

    Both models need to have the same number of vertices, in the same order. If they were derived from the same basemesh, they should… (exporting, editing, or adding sub-meshes might change the vertice order, but just dialing in morphs should be good.)

    The blend shapes are just the changes to the verts original positions – so assuming the 2 bodies have the same vertice order, the blend shapes will copy over from A to B. The 'new' figure's blend shapes will also just be the changes, so if you copy facial blend shapes from A they will be same blend shapes but starting with B's face. (smile will still be smile, but it will be B's face morphed to smile)

    (most figures will have submeshes: body, eyes, lashes, hair, clothing, etc… You might need Skinn to split the submeshes so you can apply only the blend shapes that correspond: bodyA to bodyB, LashesA to LashesB, etc. Skinn can recombine the submeshes after.)

    IF… the 2 figures started out as different basemeshes… completely different models, then unfortunately, the best you can do is probably a 'lattice' deformer which is similar to how 3D clothing follows the body mesh. "Lattice' will try to keep the vertices on both models relatively aligned, but this is going to be tough to align lips and eyelids and small detail… that's probably a job for something like Wrap3 that's designed to wrap base meshes around head/body scans.
     
    Last edited: Dec 4, 2020
    Duffer123 likes this.
  40. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @wetcircuit , Thanks for the detailed response.

    I have the horrible feeling I am missing an obvious solution here with Unity and Skinn:VM Pro.

    I want to use the shape of (in above example) model B AS a blendshape added in to model A so in model A when you slide that new blendshape up to 100 it moves towards the shape of model B...

    So I am exporting in to Unity the CC3+ neutral model as an fbx. It only has facial blendshapes. I am then using the morph sliders on the same CC3+ neutral model to say make it look fat. I am then exporting that fat model in to Unity as an fbx. So let's then call the neutral model Model_Normal and the fat model Model_Fat. They both come from the same origin CC3+ Neutral model but the latter was made to look fat in CC3 before being exported in to Unity as an fbx. I think they will both have the same number of vertices in the same order and both will derive from the same base mesh in CC3+ before export.

    What I want is to add in to Model_Normal a blendshape ultimately called say 'GetFat' and I want to somehow use something in Model_Fat to create that blendshape which I add in to Model_Normal.

    What do I do to achieve this?

    Do they both need to be in bind pose? And/or both fully unpacked from prefabs when in the scene in Unity? Or do I have to create from scratch an obj mesh of Model_Fat to achieve what I want?

    I hope you get where I am coming from.

    One drawback with CC3 when exporting into Unity is you cannot export the model with any of the body morphs from CC3 as then blendshapes in Unity... So with the above I am trying to implement some limited work-arounds to achieve this using Skinn...
     
    Last edited: Dec 4, 2020
  41. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    this should work. They do need to be in the same pose.

    Here's a tutorial that shows it (skipping to the relevant part, but you might want to watch the whole thing if it still seems confusing): Mesh to Blend Shape

    If you can export the 'morph' as an obj, you can turn it into a blend shape with Skinn. (if you can only export a rigged FBX for the morph shape, you can extract the mesh from the figure as shown earlier in the same video)
     
    Duffer123 likes this.
  42. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @wetcircuit , thanks once again. I'm going to persevere with this, watch your vid more closely and let you know how I get on.
     
  43. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @wetcircuit , OK, so I imported the two models and made sure they models were imported the same - enabling read/write etc. When I bake the mesh renderer out as a mesh, that works totally. I then try and copy and paste in that baked-out mesh as a blendshape (as in your vid) on the original model - it creates a blendshape but, bizarrely, the name of the blendshape is the name of the model I am trying to add the blendshape too and not the name of the renamed baked out mesh/mesh-renderer (if you see what I mean) and, although the blendshape is in place, it does nothing when I change the slider up. Any ideas? (I could pm you both models if you like?) I suspect I am still missing something obvious.
     
  44. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    It sounds like the blend channel was created, but the actual shape wasn't added…

    Earlier in that same video, I show how to extract the mesh with a couple of BS blended in, then add that mesh back as a new blend shape (basically combine a couple existing shapes into one new). See if you can do that part with your CC3 figure.

    I don't know CC3, but I suspect the figure has sub-meshes that might be getting in the way. There are a few other posts here from CC3 users and maybe CWManly has some ideas...
     
    cwmanley and Duffer123 like this.
  45. Czeus

    Czeus

    Joined:
    Jan 12, 2015
    Posts:
    10
    I have a question similar to pigglet. I have two identical models, one with a regular mesh renderer but changed with a custom effect (mesh A) and another with a regular skinned mesh (mesh B).

    I want to copy the effect from mesh A to mesh B in runtime. Currently, I've tried to do it like this:

    Code (CSharp):
    1. var renderer = sourceRenderer;
    2. newMesh = renderer.CloneSharedMesh();
    3. targetSkinnedMesh.SetSharedMesh(newMesh);
    ,but that makes it extreme laggy. Is there any way to do this with skinn pro in runtime but with no lags. When I try to do it from the inspector's level, e.g. through copy and then paste mesh and blendshape, everything is fine, but I would like the effect to be constant and not laggy.
     
  46. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Hi, sorry for the delay.

    You can use the Copy/Paste commands or the Shapes/Load command to for CC3. I have used the Load command with CC3 before.

    1. Export you base.
    2. Export each of you shapes you want.
    3. Place the base mesh in the scene.
    4. Use the command Skinn:Edit/Shapes/Load to bring up the Load Wizard
    5. Add the shape export game objects to the array.
    6. Press create.
    You might have use prefab or scene objects to edit the names of the skinned mesh renderers to set the blend-shape name you want.

    Tips
    • You can create one prefab with all the exports with and use that with the Load Wizard. The wizard will look through all the children in a game object for shapes.
    • Using the Load wizard can give you better looking normals and tangents over importing a mesh with blend-shapes.
    • A mesh with imported with blend-shapes can have a different vertex count than the same mesh with out blend-shapes, I have only noticed this when exporting from daz.
    • mesh import settings can change the vertex count shape exports be aware of that when changing the normal and tangent modes.
    If your still having issues you can pm or email me cwmanley@gmail.com and I will find a solution asap.

    Thanks
     
    Duffer123 likes this.
  47. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    @cwmanley thanks. I was giving up hope there. The copy n paste doesn't work. With 1 and 2 above, and 5, am I exporting these as fbx for unity from cc3 with the whole import pipeline dll, or something else?
     
  48. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    Are you trying to copy the effect every frame? You might want to change the target mesh's vertex information directly rather than creating a new mesh.

    In runtime you can use Mesh.vertices in edit mode you have to use SharedMesh.vertices.
    https://docs.unity3d.com/ScriptReference/Mesh-vertices.html

    What kind effect are trying to copy I am glad to help if I can.

    Thanks
     
  49. cwmanley

    cwmanley

    Joined:
    Aug 8, 2013
    Posts:
    205
    It has been awhile since I used cc3, but I just used fbx.
     
    Duffer123 likes this.
  50. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,216
    Excellent - thanks again! I will give this a whirl and see if I can make it work. If I can't could I pm or email you the models (Base and other shapes) in question and see if you can figure out a workflow that works?

    [edit] - I'm assuming here that I can put each of the humanoid models from cc3 as fbx's under say a blank main GameObject in scene and go with the Load Wizard from there?