Search Unity

TOZ Vertex Painter

Discussion in 'Assets and Asset Store' started by aubergine, May 11, 2015.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Version: 1.1.0

    Description:

    This simple editor tool helps to easily paint vertex colors on any 3d mesh and save it as a new mesh with vertex color data.
    Pack also includes an Unlit and a Standard shader variation that does splat mapping with 4 different textures based on mesh vertex colors.

    Get it on ASSETSTORE for FREE!!!

    vpaint.jpg
     
    Last edited: Sep 26, 2022
  2. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Video tutorial on how it Works.

     
  3. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    336
    hello is the painted mesh, for each mesh requires a different copy of material?
    or i can use same material + shader + textures, and apply paint on different models each with different paint?

    thanks
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Painted meshes can share same material/shader/textures. But different paint means different mesh.
    Final result after painting is saved as a mesh object, so you must apply this saved mesh to the "mesh" on your MeshFilter.
     
  5. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    336
    so in order to have same mesh character with same material but with different two paint jobs, i have to clone mesh and save each as separate mesh correct?
     
  6. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    The paint tool doesnt let you save on the original mesh anyways, it always asks you to save the painted data as a seperate new mesh.
    So, yes in order to have same mesh with different paint jobs, you must have 2 or more different mesh data.
    Mesh and the object representation in your editor are different stuff, mesh is just an asset that holds vertex/index/uv/color...etc arrays.
     
  7. wadewt

    wadewt

    Joined:
    Mar 17, 2013
    Posts:
    16
    Has a real hard time painting on big meshes. It'll work if I scale my mesh down but then it'll only paint the entire mesh in one stroke. Can't seem to make it work. Also it's way too easy to accidentally undo all your painting if you stop painting or click one of the fill buttons, I feel like there should be a dialogue for these.

    EDIT: I think I've found out the cause of the problem. I made sure my mesh' file scale and import scale and in scene scale were all 1. I'm not sure which of these causes problems but never mind. The main problem I think was because it was a child of an object with a scale that was not 1, so its scale was being set to .002 or something when I childed it. Regardless it'd be super nice if this tool could work regardless of scales. It works really nice when it does.
     
    Last edited: Oct 3, 2015
  8. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Well, there was a small bug.
    Please edit the VertexPainter.cs file and change the line 241 into the following:
    Code (CSharp):
    1. Vector3 hitPos = Vector3.Scale(go.transform.InverseTransformPoint(hit.point), go.transform.lossyScale);
    also the line 243 into the following:
    Code (CSharp):
    1. Vector3 vertPos = Vector3.Scale(vertices[i], go.transform.lossyScale);
    EDIT: The above will solve the scale problem, it used to ignore if an object was in a hierarchy, with the global scale; it will work as you want.

    EDIT2: It is possible to make an undo button however it will cause memory leaks to temporarily save the data. And it is not allowed for editör tools.
     
  9. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    This package is now free at the assetstore.
     
  10. NeedNap

    NeedNap

    Joined:
    Nov 1, 2012
    Posts:
    22
    Hi,
    can I use it to paint textures dynamically at run-time using the ray cast method to know the exact point?
    If yes, can I paint with different brushes (like a decal)?
    Thanks
     
  11. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    This is an editor script as is, but all the necessary code is there and package is free.
    So, you can code it yourself. If you get stuck, i would like to help if i have the free time.
     
  12. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Just had some free time to update this handy tool. New features are:
    • Slightly faster painting
    • Custom save location for the painted mesh
    • Minor bug fixing
    • Updated shaders for Unity version 2020.x
    • Documentation is now online (WIP continuously)
    Download link at first post.
     
  13. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    I see the unity changed hashing in 2021.3.x versions, If you are using 2021.3.x and having problems, just delete the line 236 and it will work as desired again.
     
  14. AqueuseAkaLLO

    AqueuseAkaLLO

    Joined:
    Aug 18, 2021
    Posts:
    9
    Hello aubergine, I try to use your tool. I'm on unity 2022 with the Universal Render Pipeline. Unfortunately the material created by TOZ Vertex Painter is Pink and I can't figure out how to make it work. I have try to update the material to URP with no success.

    Can you help me please ?
     
  15. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    Hello, unfortunately i dont plan to support URP or HDRP as they are incomplete and useless. The created material is just an average vertex color shader which you must write yourself for urp or hdrp and point the script to the newly written shader(s).
    However, why bother and just work in standard renderer while painting your objects and then you can import them back to your urp project?
     
  16. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,880
    new update available:
    * Forced ads and obsolete api calls removed.