Search Unity

Script for importing Adobe Fuse character model into Unity (fixes materials)

Discussion in 'External Tools' started by saulth, Jul 7, 2017.

  1. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    I have made a script that imports characters from Adobe Fuse CC (Beta) and makes the necessary modifications to the materials and texture maps. Without this script the imported character materials are all broken.

    Note, the attached script is not designed to work with characters downloaded direct from the Mixamo store. It is designed to take a character that was made in Fuse, and uses the textures that Fuse exports that are designed for use with Unity. The textures within the FBX files are not ideal for use in Unity.

    Using this script the results are quite close to the quality within the Fuse window e.g.

    example.jpg

    To use the script:
    • Download MixamoUnityImporter.cs
    • Within Unity create folder called Mixamo
    • Create a folder within Mixamo called Editor
    • Copy the script into the Editor folder
    • Now the script should exist as Assets/Mixamo/Editor/MixamoUnityImporter.cs

    The workflow is as follows:
    • Create a model using the Adobe Fuse application
    • Export textures for Unity 5 into a new folder with the same name as the character
    • From Fuse select File --> Animate with Mixamo
    • Download the rigged character as a Unity FBX file
    • Save the Mixamo FBX file beside the exported textures folder
    • In Unity, click the menu Mixamo --> Import from Fuse with exported Unity textures
    • Choose the FBX file to import
    This results in importing the character to Assets/Mixamo/[Character Name]/ and a prefab is created that references the updated materials.

    To see some examples of the problem see:
    Most solutions say to simply set the shader render modes to Opaque or Transparent/Fade, but this is only part of the solution this script performs:
    • Set shader render modes correctly per material
    • Create new materials for Eyes and Eyelashes
    • Correct the MetallicAndSmoothness map (has inverted alpha)
    • Set texture import settings correctly (alpha channel, normal maps)
    • Set smoothness per material to roughly match visuals in Adobe Fuse CC (beta)
    • Create prefab ready for easy use
    UPDATES:
    • Updated to handle masks (partially), gloves, shoes, hats.
    • Updated to correctly handle non-alpha hair.
    • Update to fix problem when textures are reimported e.g. by copying the imported character folder to another computer, or pulling commits of characters from Collaborate.
     

    Attached Files:

    Last edited: Oct 18, 2017
    mgear, mjh79, fairtree and 7 others like this.
  2. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Updated to handle masks (partially), gloves, shoes, hats.
     

    Attached Files:

    fairtree, krougeau and wetcircuit like this.
  3. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Updated to correctly handle non-alpha hair.
     

    Attached Files:

    fairtree, krougeau and wetcircuit like this.
  4. zachholt

    zachholt

    Joined:
    Aug 31, 2014
    Posts:
    3
    Thanks! I will try this out.

    Edit: Works great!
     
    Last edited: Aug 5, 2017
    unity_UC_9K-9l-dkXTw likes this.
  5. Jaramal

    Jaramal

    Joined:
    Mar 3, 2017
    Posts:
    3
    Nice job, works like a charm !
     
  6. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Glad it works for you :). My main problem with it still is that I can't work out how to automatically set the model to Humanoid during import. Apart from that it still probably needs manual tweaks to the material parameters to best match what we see within Fuse.
     
  7. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    I'm trying this script out, downloaded some characters from the Mixamo store but there is no exported textures folder with the characters, only the FBX models. When I try the import it gives me this error:

     
  8. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Yeah, this script is designed to work with a character that was created in Fuse, then uploaded to Mixamo, then downloaded again. Fuse can export textures designed specifically for Unity.

    I have another (earlier) version of the script that works without the exported textures from Fuse i.e. can work with FBX direct from Mixamo store, but the quality is not as good, and so I didn't put as much effort into that version of the script.
     
  9. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    Ok, I was just playing around and noticed that when I imported the models into Akeytsu it created a "modelname.fbm" folder. I renamed the folder to "modelname" and the import seemed to work but then gave this critical error:

    ...and the models came in untextured; however, I noticed the texture names are not the same as the model names. Is this a problem?
     
  10. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Yeah it is a problem. As I said above, this script is designed to work with the textures exported from Fuse, not the textures that are within the FBX file. I'll upload the older version of the script that uses the FBX only, but the results are not as good as when using textures exported from Fuse.
     
  11. jabevan

    jabevan

    Joined:
    Apr 2, 2016
    Posts:
    72
    No, it's ok. I'd rather figure out what the naming convention is from Fuse and just set up the same naming conventions for the Mixamo store characters. I haven't used Fuse, can you just give me the example naming conventions for the textures?

    EDIT: Nevermind, I just tested Fuse and see that it exports an AO, Base Color, Metallic, Normal and Roughness. The Mixamo store only exports Diffuse, Normal and Specular. I see that it's more than a naming convention issue...
     
    Last edited: Aug 9, 2017
  12. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Here's an example of a character created in Fuse called "FemaleScan1b". I'm not sure this will help with the script. The script assumes you are working with the Fuse character, not the Mixamo store characters. The store characters have some different structures in their FBX files that the script will fail to pick up on. I won't upload the old version of the script, it's broken, sorry.
     

    Attached Files:

  13. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Note that the folder in the above image was created by Fuse when exporting textures specifically designed for Unity. The FBX files contain different file formats that will not work as well, and will not work with this script.
     
    jabevan likes this.
  14. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Update to fix problem when textures are reimported e.g. by copying the imported character folder to another computer, or pulling commits of characters from Collaborate.
     

    Attached Files:

  15. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    Hi I get this error when trying to use your script.

    NullReferenceException: Object reference not set to an instance of an object
    MixamoUnityImporter._process_model (System.String character_name, System.String folder, System.String filename) (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:270)
    MixamoUnityImporter.ImportCharacter () (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:102)
     
  16. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    First, be sure you are using the latest version. Also, note that this script only works with characters exported as FBX from Adobe Fuse CC (Beta), with textures exported from Fuse specifically made for Unity. Other characters, including many of those downloaded from Mixamo, will have a different and incompatible configuration. It does however work for characters originating from Fuse, uploaded to be rigged by Mixamo, then download the FBX for Unity.

    If this is your case then there must be a bug, and it would help if you could give me a copy of the character you are attempting to import so I can reproduce the problem here.

    Cheers,
    Saul.
     
  17. ngurasailo1978

    ngurasailo1978

    Joined:
    Oct 3, 2017
    Posts:
    1
    i imported Mixamo fbx to 3ds max and without changing anything, i export it to fbx from 3ds max. then i import to Unity. No errors. A little light colored on the texture though, but for my use, its negligible
     
  18. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    I uploaded the file here - http://digitaleon.com/scratch/gunman.zip
    Same error here, only difference from your instructions is that I included a single animation from mixamo. The file is partially imported but there is no prefab.

    NullReferenceException: Object reference not set to an instance of an object
    MixamoUnityImporter._process_model (System.String character_name, System.String folder, System.String filename) (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:270)
    MixamoUnityImporter.ImportCharacter () (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:102)
     
    Last edited: Nov 7, 2017
  19. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    More information - I tried just grabbing the FBX without animating it first...the same thing happens.

    NullReferenceException: Object reference not set to an instance of an object
    MixamoUnityImporter._process_model (System.String character_name, System.String folder, System.String filename) (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:270)
    MixamoUnityImporter.ImportCharacter () (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:102)
     
  20. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    783
    @L-Train - make sure that the filename of your Fuse model doesn't contain any underscores. The script looks for the base name of the texture files by splitting the string at the "_" character, as that is how the textures and materials are named. So it looks for the texture at the wrong path.

    If it does contain underscores, then re-export the model from Fuse (via Mixamo) using a name without underscores, and try the process again.
     
    Russellinho likes this.
  21. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    would you tell me what your doing to the images?
    I can just create my own shader with ShaderForge.

    I am combining meshes for a max of two materials, meaning I am pushing my Fuse model through twice..losing all body part separation, so your script is too rigid in naming conventions, to actually work on my pipeline.

    I'll post it for free, just having problems with the combined Metal/Smooth...
    you said the alpha was reversed?

    my Fuse shader (still a little funky)



    I can go through your code line by line, but maby you can just tell me what your doing with the images,,just that.

    curious, thanks

    p-
     
    Last edited: Nov 11, 2017
  22. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    the filename was simply "gunman".
     
  23. scprotz

    scprotz

    Joined:
    Nov 26, 2017
    Posts:
    3
    I tried using it. I get the same NullReferenceException.

    // Create Eyes and Eyelashes materials from the Body material.
    var body_mat = materials.Find(m => m.name.Contains("_Body"));
    var mat_prefix = body_mat.name.Split('_')[0];

    Seems to have an issue with finding _Body materials (I'm reading through the code now and seeing if I can come up with a workaround). Apparently body_mat is not getting set. Not sure where this _Body material came from. Fuse did not give me one. Curious if the script was supposed to generate it but didn't.
     
    L-Train and carolinegj like this.
  24. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    Given that Scprotz is seeing the problem too - any updates on this issue?
    I haven't stepped through the code myself yet - for those that have looked at it - any thoughts on a fix?
     
  25. KIxd

    KIxd

    Joined:
    Jan 18, 2018
    Posts:
    4
    hey,

    hope to get help with this :(

    I get
    Assertion failed: Assertion failed on expression: 'ptr->GetHideFlags() == m_RequiredHideFlags'
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    and no textures shown... named the texture folder from fuse char01 und imported the char01.fxb and the textures are next to the model in unity in a folder called "textures" but they're not connected in any way... :/

    How can I disable smileys? XD
     
  26. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    put it as code


    Code (CSharp):
    1. Assertion failed: Assertion failed on expression: 'ptr->GetHideFlags() == m_RequiredHideFlags'
    2. UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  27. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    Has anyone gotten this thing to work or is it dead and abandoned?
     
  28. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Sorry, I've been away. This script wasn't released in any officially supported way, however. It really is just "as-is", and is somewhat brittle code that worked only for characters pre-supplied within the Adobe Fuse program (male/female fit/scan 1,2,3,... and a single zombie).

    @L-Train I've looked at the provided gunman.zip and can repro the crash. It appears you've exported the object, modified the character, and importantly changed the textures -- which is breaking the script assumptions. The texture expected names are not being found, rather the textures are all now packed into a single texture. After the import crashes, the files are still there and can be manually attached to the material, and manually set the material Rendering Mode to Opaque (this works for all texture component on this model except the eyelashes -- packing makes it impossible to set the two modes required to make both body and eyelash textures work).

    @ForceVFX The metallic/smoothness textures need their alpha channel to be inverted to work correctly. The script does this in MixamoAssetProcessor::OnPostprocessTexture() by setting alpha to (1 - alpha). Your shader looks great :) so I'm sure it already does the right thing here, on-the-fly, without need to change the texture itself.

    @KIxd I have not seen this assertion, so cannot reproduce the problem to attempt a fix. The quoted code is not within my script so I'm at a loss.
     
  29. jermerqua03

    jermerqua03

    Joined:
    Feb 7, 2018
    Posts:
    6
    So am fairly new to this Fuse>Mixamo>Unity pipeline but a big fan in general of it in theory. However when I first went through it I was surprised to see no textures from Mixamo were applied even though I was exporting for unity FBX. I found your post and got excited. Installed your scrip. Ran it. And STILL not textures at all applied to the FBX. Same name used on texture folder and FBX. Not sure what i am doing wrong.
     

    Attached Files:

  30. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    @jermerqua03 It's strange to get no texture at all. Before writing this script there were always textures, they all just looked at bit off. If you could attach the FBX then I could take a quick look.
     
  31. jermerqua03

    jermerqua03

    Joined:
    Feb 7, 2018
    Posts:
    6
    I actually was able to figure this one out. The FBX did not have any immediate textures visible but once I clicked on "materials" tab and then selected "import textures" they appeared. I was then able to "create materials" and change the materials to "legacy diffuse" which made the model look like the original fuse model. A bit of a process BUT it works.
     
  32. jermerqua03

    jermerqua03

    Joined:
    Feb 7, 2018
    Posts:
    6
    I selected "upload file" from here by the way to share FBX but it won't let me upload FBX for some reason :-/
     
  33. L-Train

    L-Train

    Joined:
    Oct 19, 2012
    Posts:
    10
    I can confirm the blank texture bug. I attempted to use this tool again and didn't apply any animations or other changes to the character. I get a model with zero textures. I mucked around with the settings and got the textures to appear - but the alphas are still completely messed up.
     
  34. fairtree

    fairtree

    Joined:
    Jun 11, 2012
    Posts:
    78
    Do it under 2017.1
    Export
    Import to your Unity version above 2017.1

    A huge Thanks to saulth for this job!!
     
    saulth likes this.
  35. reallypeople

    reallypeople

    Joined:
    Jul 11, 2013
    Posts:
    21
    @saulth Hi, I was very excited to discover this script, as although I was getting OK results with Fuse characters in Unity by manually tweaking the materials in Photoshop and Unity, they never looked quite as good as they do in Fuse!

    I'm using the latest Adobe Fuse CC and Unity 2017.3, following your instructions to the letter, and the script is throwing a null exception at line 270:

    var mat_prefix = body_mat.name.Split('_')[0];

    The error is:
    NullReferenceException: Object reference not set to an instance of an object
    MixamoUnityImporter._process_model (System.String character_name, System.String folder, System.String filename) (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:270)
    MixamoUnityImporter.ImportCharacter () (at Assets/Mixamo/Editor/MixamoUnityImporter.cs:102)

    I know you've shared this script 'as-is' but if you could spare a moment to see if you could reproduce this, I'd be very grateful.
     
  36. reallypeople

    reallypeople

    Joined:
    Jul 11, 2013
    Posts:
    21
    Looks like @fairtree may have solved this already. I just need to use 2017.1, right?
     
  37. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    I'm not sure, I haven't tried in newer versions.
     
  38. reallypeople

    reallypeople

    Joined:
    Jul 11, 2013
    Posts:
    21
    hungrybelome, fairtree and saulth like this.
  39. reallypeople

    reallypeople

    Joined:
    Jul 11, 2013
    Posts:
    21
    @saulth Between 2017.1 and 2017.3 Unity have added a Materials tab to the model import settings panel and some additional options for importing materials and textures. I suspect this is what is screwing up your script in that version.
     
  40. saulth

    saulth

    Joined:
    Mar 20, 2015
    Posts:
    17
    Thanks for the info, I'll take a look when I get to upgrading.
     
  41. Zoryth

    Zoryth

    Joined:
    Dec 5, 2016
    Posts:
    33
    Does it work in 2018.2? well lets find out
     
  42. GamePyro

    GamePyro

    Joined:
    Jul 28, 2018
    Posts:
    154
    I only get white / grey characters all done right :( also no shader set from the script :


    errors:

    NullReferenceException: Object reference not set to an instance of an object
    MixamoUnityImporter._process_model (System.String character_name, System.String folder, System.String filename) (at Assets/Mixamo/Editor/MixamoUnityImporter (1).cs:322)
    MixamoUnityImporter.ImportCharacter () (at Assets/Mixamo/Editor/MixamoUnityImporter (1).cs:102)
     
    Last edited: Sep 28, 2018
  43. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    368
    @GamePyro did you ever get that figured out?
     
  44. Russellinho

    Russellinho

    Joined:
    Jan 1, 2016
    Posts:
    8
    Ingenious; thank you!
     
    TeagansDad likes this.
  45. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    190
    This doesn't seem to work in 2018.3 -

    DirectoryNotFoundException: Destination directory not found:
    System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    MixamoUnityImporter.ImportCharacter () (at Assets/Scripts/MixamoUnityImporter.cs:91)

    Can't understand why Adobe don't resume work on this program.
     
    JamesArndt likes this.
  46. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    look at the script MixamoUnityImporter.cs @ line 91..the "String" ..in the ImportCharacter function...probably the alpha textures name, its an input output problem, meaning string names don't exactly match, look in the code for the hard coded extension, its looking for, wrapped in single quotes., change the texture name to that value, that's what the error , says to me -p
     
  47. bravo79

    bravo79

    Joined:
    Jan 8, 2019
    Posts:
    1
    Hello,

    I am new to unity and coding. I am using Unity 2018.3.9.f1. I am creating a lot of characters for my project. I have followed the instructions on creating and exporting characters mentioned above.
    I am stuck on importing the finished characters into unity.

    I received this message in the console (Assets/Mixamo/Editor/MixamoUnityImporter.cs(335,11): error CS0152: The switch statement contains multiple cases with the label value '47') and I do not know how to proceed.

    I also cannot seam to find the
    • In Unity, click the menu Mixamo --> Import from Fuse with exported Unity textures
    referenced in the last steps of the workflow.

    Can anyone help?
     
  48. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    ok, just checked the code, no case "47", so looks like a script error, , delete that copy , reimport the original script above in a folder called Editor..only then will unity recognize the 'editor' calls, ie, add shortcut "Mixamo.....".


    ie
    • Download MixamoUnityImporter.cs
    • Within Unity create folder called Mixamo
    • Create a folder within Mixamo called Editor
    • Copy the script into the Editor folder
    • Now the script should exist as Assets/Mixamo/Editor/MixamoUnityImporter.cs

    p-
     
  49. truebototics

    truebototics

    Joined:
    Jan 2, 2016
    Posts:
    22
    This looks awesome. Is there any chance you might have an updated script to have it working in Unity 2018.3?
    I tried adding the script to the Mixamo/Editor folder but still got the following error:

    Assets/Mixamo/Editor/MixamoUnityImporter.cs(335,11): error CS0152: The label `case 47:' already occurs in this switch statement

    Any help would be appreciated. Thanks so much
     
  50. ForceVFX

    ForceVFX

    Joined:
    Jan 21, 2011
    Posts:
    575
    you need to learn, the basics of coding 101, you don't know enough, to even debug that? stop , learn, try again.
    this a free script, its your responsibility, no one else's.

    it is in english, and is telling you what to do!
    scared to open a text editor, and delete a case statement?

    yes, stop , learn, try again.

    it hard, intimidating at first, even after 10 years, I screw up.
    yesterday, I spent 4 hours trying to get a camera to switch from cockpit to flight view, on a simple bool, yes or no..., back and forth I went, debug logging, yelling, slamming my keyboard, not realizing, I had set that to always be true, somewhere earlier in my code, I am a idiot sometimes!..anyway

    Debug.Log("texBase.format" + texBase.format);
    is the only way a NUMBER 47 MIGHT APPEAR. I don't know..

    but the numerals 4 and 7 NEVER APPEAR TOGETHER, IN QUOTES, out of quotes, EVER, in this script as a case statement. in the script posted saulth, Sep 4, 2017

    unless texBase.format is being converted to integers, then compiled, as a string, and 2 different texture formats have the exact same unity hard coded integer values, in the look up table. which, would be a legitimate BUG, error, oversight, and if validated, should be reported, but it does not mean you can't fix the problem, you work around it.

    only way to be sure, debug log every format listed, just for kicks.
    Debug.Log("TextureFormat.ARGB4444: " + TextureFormat.ARGB4444); //what does it print out? for all listed below (except case BlendMode.Opaque:, etc, those work)

    or, delete the ones you don't use
    compress your images and only use etc compression?

    case TextureFormat.ETC2_RGBA1:
    case TextureFormat.ETC2_RGBA8:
    case TextureFormat.ETC_RGBA8_3DS:

    get my point?

    all cases:

    case TextureFormat.ARGB4444:
    case TextureFormat.RGBA32:
    case TextureFormat.ARGB32:
    case TextureFormat.RGBA4444:
    case TextureFormat.BGRA32:
    case TextureFormat.RGBAHalf:
    case TextureFormat.RGBAFloat:
    case TextureFormat.PVRTC_RGBA2:
    case TextureFormat.PVRTC_RGBA4:
    case TextureFormat.ATC_RGBA8:
    case TextureFormat.ETC2_RGBA1:
    case TextureFormat.ETC2_RGBA8:
    case TextureFormat.ASTC_RGBA_4x4:
    case TextureFormat.ASTC_RGBA_5x5:
    case TextureFormat.ASTC_RGBA_6x6:
    case TextureFormat.ASTC_RGBA_8x8:
    case TextureFormat.ASTC_RGBA_10x10:
    case TextureFormat.ASTC_RGBA_12x12:
    case TextureFormat.ETC_RGBA8_3DS:
    case TextureFormat.DXT5: // NOTE: DXT5 has alpha, DXT1 is usually non-alpha


    case BlendMode.Opaque:
    material.SetOverrideTag("RenderType", "");
    material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
    material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
    material.SetInt("_ZWrite", 1);
    material.DisableKeyword("_ALPHATEST_ON");
    material.DisableKeyword("_ALPHABLEND_ON");
    material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
    material.renderQueue = -1;
    break;
    case BlendMode.Cutout:
    material.SetOverrideTag("RenderType", "TransparentCutout");
    material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
    material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
    material.SetInt("_ZWrite", 1);
    material.EnableKeyword("_ALPHATEST_ON");
    material.DisableKeyword("_ALPHABLEND_ON");
    material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
    material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.AlphaTest;
    break;
    case BlendMode.Fade:
    material.SetOverrideTag("RenderType", "Transparent");
    material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
    material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
    material.SetInt("_ZWrite", 0);
    material.DisableKeyword("_ALPHATEST_ON");
    material.EnableKeyword("_ALPHABLEND_ON");
    material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
    material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
    break;
    case BlendMode.Transparent:
    material.SetOverrideTag("RenderType", "Transparent");
    material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
    material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
    material.SetInt("_ZWrite", 0);
    material.DisableKeyword("_ALPHATEST_ON");
    material.DisableKeyword("_ALPHABLEND_ON");
    material.EnableKeyword("_ALPHAPREMULTIPLY_ON");
    material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent;
    break;


    and the 47 is?????
     
    Last edited: Apr 5, 2019
    NextGenAssets and fairtree like this.