[FREE] YAPP - Yet Another Prefab Painter (Open Source, GitHub)

Yeah, in addition to that there’s also the operations tab. You can e. g. select randomly few, medium, many, all prefabs and then use Unity’s standard means to lower the selected ones.

2 Likes

I love this! So glad I’m starting a new project. :slight_smile:

2 Likes

Hello !
Fantastic asset !
However, I got a little error:
Assets\Yapp\Editor\UIComponents\BrushComponent.cs(3,19): error CS0234: The type or namespace name ‘UIElements’ does not exist in the namespace ‘UnityEngine’ (are you missing an assembly reference?)

I’m using Unity 2018.4.21f1 (64-bit), Package manager UI 2.0.8.

Thanks for reporting this. I uploaded a fix. It was just a redundant Unity import that didn’t exist in 2018.

1 Like

I can’t figure out how to actually paint the stuff on the terrain

Use the shift key and drag the mouse, the blue circle should become green then. ctrl+shift removes the prefabs. See the on-screen instructions here:

6527379--736989--instruction.jpg

In case it is a problem of the general setup, I made quick video for you:

https://www.youtube.com/watch?v=kLV0_F8GO-w

Basically you have to

  • add the YAPP GameObject
  • create a container for the Prefabs; note: I dragged the container out of the YAPP GameObject simply because Unity would select all the children by default which could cost performance if you have 1000s of them in there; you can assign any gameobject as container manually
  • drag in Prefabs which should be used
  • add via shift + mouse drag, circle becomes green
  • remove via shift + ctrl + mouse drag, circle becomes red
  • brush size can be chanced via ctrl + mouse wheel
2 Likes

This looks great. I develop a fishing game and looking at this tool, it will be useful for spawning many things.

One thing I would like if possible is the ability to draw a spline around my lake without adding points, somehow automatically points are added from where I’ve drawn, it would be so much faster, not sure it’s possible though.

I’ve not seen it but is it possible to spawn only within a spline shape?

Spawning inside a closed Spline isn’t supported now. Basically that’s just spawning inside a polygon. I think Vegetation Studio Pro and its Biomes are better suited for that purpose, in case you have it.

But I can certainly look into it.

Just wanted to stop by and say this tool is fantastic, I’m surprised you’re not selling it on the asset store - I’d definitely buy it again.

Many thanks for making it open source and free!

1 Like

In order to make it all more convenient I added templates for the prefabs. Those are predefined settings for the prefabs. Example: A rock can be usually rotated in all directions, a tree can usually be only rotated around the Y axis.

Just drag your prefabs over the template you wish to use:

6615001--753154--template.png

Object is like it was before.

I made it flexible, so that you can define your own templates and collection. The collection is stored in “Prefab Template Collection”:

6615001--753157--collection.png

You can add your own by modification of the array.

The settings themselves are in prefab settings templates, e. g. Rock:

6615001--753160--rock.png

Here’s how it looks for trees and rocks:

Important: If you create your own, then you need to save the scene for it to become effective. So if you edit your Rock setting, it will only applied after a save. It’s a Unity thing with Scriptable Objects.

5 Likes

Bug? Is Poisson Disk Distribution Mode broken? Prefabs appear offset in y-direction. Prefab is at 0,0,0, the container as well. “Center” is working correctly, so what can I do?

Missing in the video: When I then move the container lower to “fix” it and continue painting, it’s offset again on the same amount.

That’s odd. I just tried to reproduce, but couldn’t. Which tree prefab are you using there? And what are the settings for it in the prefab section of YAPP?

https://www.youtube.com/watch?v=VNSNfp3fWbQ

1 Like

Hey @Rowlan , Here are the settings in an album:

I’m using an empty GameObject, attaching the PrefabPainter and use that exact empty as the container as well. But I tried a different gameObject as container as well. Everything is at 0,0,0 I guess.
Using “New” as a container (which creates a child) doesn’t work either.

  • same behaviour when I use a different prefab.

edit: I think I got it. The terrain is at y:-47 and the objects are placed 47 units too high. (I subtracted 47 to check)

But it doesn’t happen on “Center” Mode. Workaround for me: Place Terrain mesh on 0,0,0 and raise it for example. But it seems like a bug. Also: When I place my terrain on 50, the prefabs are placed 50 too LOW. So do you have a sign error here? :stuck_out_tongue:

1 Like

To fix YAPP, you need to edit BrushModuleEditor.cs:417
from

    // get terrain y position
    float y = Terrain.activeTerrain.SampleHeight(terrainPosition);

to

    // get terrain y position
    float y = Terrain.activeTerrain.SampleHeight(terrainPosition) + Terrain.activeTerrain.GetPosition().y;

Because after that, the position is simply set to:

    // create position vector
     Vector3 prefabPosition = new Vector3( x, y, z);

And then, y is only the sampled height. The Terrain Transforms y-position is lost because of that. The incoming Vector “position” from the Raycast of course was correct, but sampling around the raycast-hit is done in the foreach loop.

I just created a Pull-Request on your Github :slight_smile:
https://github.com/Roland09/PrefabPainter/pull/4

1 Like

Thank you! :slight_smile: Merged it. Gonna shift my demo terrain again. I had it before at y != 0 for exactly that reason, i. e. detect those kinds of errors. But at some point I must have reset the transform.

1 Like

I changed the behaviour of the terrain alignment vs random rotation. Now they can be combined. But please keep in mind that the values should make sense depending on your gameobject.

Example: I got the Camel Spider asset and wanted to fill a Lordenfel dungeon with it. It made sense to align the spiders on the walls. And also to rotate them in Y direction. But X and Z wouldn’t make any sense here either, they’d just look as if they stuck inside the walls. So the settings you use pretty much depend on the context.

Here’s an example:

Or final pics, filling the dungeon took just a few seconds:


2 Likes

I just had to paint in some snakes as well, literally took only a minute to do so :smile:

Indiana Jones vibes!

1 Like

This morning I started working on the Fence Builder I had on the roadmap.

Turned out to be relatively easy with the fence prefabs of Meadow Enviornment:

I’m gonna introduce more attributes to the prefab settings so that it can be generic (eg override the forward direction, etc) before I put it on GitHub.

4 Likes

Just in time for my latest project. :smile:
I need to add street lights in a city. :slight_smile:

1 Like