Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Blacksmith Demo Q&A [Paint Job, Vegetation, etc.]

Discussion in 'Community Learning & Teaching' started by lordzargon, Sep 29, 2015.

  1. lordzargon

    lordzargon

    Joined:
    Nov 8, 2013
    Posts:
    8
    The Blacksmith: Environments package (available here: https://www.assetstore.unity3d.com/#!/content/39948) contains the PaintJob, which is designed to allow you to select a collection of meshes and paint vegetation directly on to them.

    However, there's no documentation included, so I decided to figure it out and write up the steps to get it working.

    First thing's first, you need to download the package.

    As a minimum you need the following Folders/Files:
    > Features\PaintJob\[EVERYTHING IN HERE]
    > Vegetation\PaintJobTemplate.asset
    > Vegetation\PaintJobTemplate.prefab

    Then, follow these steps:

    1) You want a new GameObject with the Paintjob script attached. Name this GameObject "PaintJob" or something similar.

    2) Populate the "Painting Objects" section with your objects you want to paint on. Note: you CAN'T use parented objects in here. For example:

    Scene Hierarchy:
    -> Cube (<-- Will work)
    -> A Collection of Cubes (<-- WONT work if you drag & drop/select this)
    -----> Cube1 (<-- Will work)
    -----> Cube2 (<-- Will work)

    Its a pain, but it seems that's how the script works.

    3) Scale the "PaintJob" object you created in step 1), so that it's volume encompasses all the meshes you've attached in "Painting Objects".

    4) In Assets/Vegetation you should find a prefab called "PaintJobTemplate", drag the PaintJobTemplate into your "PaintJob" object's "Terrain Template" slot.

    6) Click "Open Paintjob" from your "PaintJob" object. You should see a terrain that now conforms to your chosen objects.

    7) Select Vegetation mode and get painting!

    The rest of the tool should be fairly self-explanatory, I've not experimented with it much, so feel free to post your results or queries here.

    Hope that helps! Happy painting!
     
    Last edited: Sep 29, 2015
  2. torbjorn

    torbjorn

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    211
    Nice work there, @lordzargon !

    Here's a few hints that might make things slightly less painful:


    1) Creation:

    There's a menu option for this: "GameObject/3D Object/Paintjob"


    2) Painting/Blocking:

    The painting objects and blocking objects arrays are really only meant to be used for very specific cases. Say that you want to paint vegetation on the roof of a single building, or have a big hero object that should block vegetation in an environment where you're painting on most other objects. Treating those explicitly by adding them to those lists makes sense (but this is also why they aren't searched for children - they were never used for hierarchies).

    The normal (intended) case is to use the layer masks to control paint receivers and blockers. So one might imagine structuring the scene such that painting layers can be set to something like Ground,Environment while blocking layers are set to something like Structures,Props. Those layer masks, combined with the bounds of the paintjob, normally gives enough control over what gets painted on, and what blocks painting.
     
    Last edited: Sep 30, 2015
  3. lordzargon

    lordzargon

    Joined:
    Nov 8, 2013
    Posts:
    8
    Ah, I had no idea! It explains a lot - I'll investigate when I get chance and update the above.

    Thanks!
     
  4. exploitedtaken

    exploitedtaken

    Joined:
    Feb 25, 2014
    Posts:
    19
    In the blacksmith demo they used vegatation system too, but i cant use it, there are too many options, shader things. I finally did paint the mesh but grass doesn't bend. Any idea?
     
  5. exploitedtaken

    exploitedtaken

    Joined:
    Feb 25, 2014
    Posts:
    19
    Btw, There are mesh paint assets on assetstore but you can paint 2d grass on the mesh with paintjob. Only thing i need its 2d grass paint on meshes. Why does it have to need script for that? In ue4 we can paint everything..
     
  6. torbjorn

    torbjorn

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    211
    If you're using just the PaintJob, the grass animation is handled by the standard unity terrain vegetation. Look at the "Wind Settings for Grass" group in the settings tab of of the Terrain child.

    (settings described here: http://docs.unity3d.com/Manual/terrain-OtherSettings.html)
     
  7. exploitedtaken

    exploitedtaken

    Joined:
    Feb 25, 2014
    Posts:
    19
    it is already set up like 0.5 0.5 0.5 all of them.
     
  8. masterofdaemon

    masterofdaemon

    Joined:
    Feb 4, 2014
    Posts:
    2
    can anyone make a video tutorial please? It's hard to handle this without video
     
  9. masterofdaemon

    masterofdaemon

    Joined:
    Feb 4, 2014
    Posts:
    2
    can't select PaintJob, how to click on it and on what and how:D?