Search Unity

MeshPaint - Dynamically paint meshes onto other GameObject's surfaces.

Discussion in 'Assets and Asset Store' started by GlitchedPolygons, Jan 12, 2014.

?

MeshPaint on Asset store...

  1. Yes pls

    60 vote(s)
    92.3%
  2. No thanks

    5 vote(s)
    7.7%
  1. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Okay people, I just submitted version 1.1 with the integrated mesh combiner... as requested above ;) Should be up for download very soon
     
  2. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Would you guys like to see a frequency property or something like that in the inspector? A property that allows you to... like... hold your paint button down and smoothly paint meshes while dragging around the circle brush?
     
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That should be pretty cool... is there a random placement option... and how is the performance with debris...
     
  4. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Great Asset,

    Can this or its API be used during game play ?

    Cheers
     
  5. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    There is no random placer button yet, I'll look into that soon. The performance with debris should be good, as in the next update (should be available as soon as it gets accepted, so within a few days) there will be a "Combine painted meshes" button in the inspector. This will allow you to combine your painted meshes into a single mesh (one for every material you used) after you're done painting. Alternatively (if you don't want to combine the meshes) you can flag everything you've painted so far as static with one click. ;)
     
    Last edited: Jan 30, 2014
  6. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    As for now it's not possible "out of the box", but I can work on such a thing if you really really need it. May I ask you what you had in mind with it during runtime? :0
     
  7. Paulo-Matias

    Paulo-Matias

    Joined:
    Jun 27, 2013
    Posts:
    31
    This a very usefull tool for sure, i use a similar tool in 3ds max and it cuts time consuming in half, thanks for your efforts on this, what impresses me is the first picture, marvelous vegetation scene, realy beautifull.
     
  8. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Thank you :)
     
  9. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    hi,

    Great Asset!!!

    Dev
     
  10. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Thanks :mrgreen:
     
  11. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Awesome,

    Would very much appreciate it if you can create an API for in game.
    I am making a level editor/creator in-game. The requirement is to allow players to customize various objects within the scene during run time.

    Just curious, is this something that can be done for the next update ?

    Cheers.
     
  12. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Wow, I think that'd take me quite a bit to program it, since I used all editor-only functions everywhere in the code :/
    What you ask is also very specific for your scenario, since I'd have to rewrite a lot of stuff inside a new script that is derived from MonoBehaviour, and base everything on the GUI you need your player to have on his screen inside the level editor.
    I am honest with you and I don't think I'll fulfill your above mentioned requirement to 100%, as MeshBrush is also intended to be very generic and, originally, an editor extension; but I am kinda sure that if somebody takes a close look at how I actually created the MeshBrush editor, deriving something from it that paints meshes at runtime instead of inside the editor shouldn't be that painful (I also commented out the most important things so it should be more or less easy to read).
    Of course you can also contact me via pm at any time if you have more case specific questions. ;)
     
  13. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Whew, sounds like the code is really married to the editor.
    Another very similar asset that I bought is red herring's shrubberry creator, the asset is built for the editor but the author separated the core functionality into an API. This way, programmers can access the API during run time and therefore makes the package much more powerful and flexible.
     
  14. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Hm, that sounds interesting. You actually got my attention on that, I put it on my to-do list for version 1.2.
     
  15. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Okay guys, MeshBrush V1.12 submitted and pending review. :D

    There is now the possibility to paint meshes continuously while holding down the paint button, and tweak the speed at which you're painting with the "Delay" parameter in the inspector (basically the time in seconds between the "full-auto" brushstrokes).
     
    Last edited: Jan 31, 2014
  16. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    Hi I just picked up MeshBrush and I would like to give it 5/5

    but when i run the demo scene i get
    "The referenced script on this Behaviour is missing!"
    on "Main Camera"

    and sure enough when i check the main camera its missing some script...

    worse when i try to pain on demo scene i get

    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. MeshBrushEditor.OnSceneGUI () (at Assets/MeshBrush/Editor/MeshBrushEditor.cs:229)
    4. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    5. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    7. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    8. UnityEditor.SceneView.CallOnSceneGUI () (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/SceneView/SceneView.cs:1649)
    9. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/SceneView/SceneView.cs:1051)
    10. UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/SceneView/SceneView.cs:928)
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    12.  
    so how do i fix...

    thanks in advance!
     
  17. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Oh... That's my fault haha, looks like I was trying something out with the camera and forgot to remove the script before packaging. I fixed it; the next update also gets rid of that null reference exception error as soon as the asset store team approves it :D
    And... Thanks for the awesome five stars :0 it really means a lot to me, I am really happy that you like my tool.
     
    Last edited: Jan 31, 2014
  18. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    I uploaded a tutorial video to YouTube with voice commentary, where I go through each of the parameters and settings and explain how MeshBrush basically works.
    Check it out ;) I'm adding it to the Asset store page description soon too. Stay tuned for more updates in the future. And as always, if you have any questions, requests, bug reports or suggestions regarding MeshBrush, feel free to just leave a comment here or contact me via PM (or even e-mail if it is urgent).

    [video=youtube_share;F5joJ2E0J9M]http://youtu.be/F5joJ2E0J9M
     
  19. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    MeshBrush V1.12 has been accepted. There is now the requested Combine Meshes function as requested, as well as the above mentioned Delay parameter. Fixed the annoying NullReferenceException errors in the console.
    More updates to follow ;)
     
  20. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Alriiiiight, MeshBrush v1.13 got accepted guys :cool:
    There is now a new foldout menu in the inspector which allows you to customize your keyboard shortcuts.
     
  21. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Nice work,

    Is there a run time feature in this new version?

    Is there a way to Paint using a Mask, for example, I have black and white image mask that I would like to use as a stencil to paint with. This mask is the kind that Airbrush or Graffiti artists use.

    Cheers.
     
  22. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Hm, I'm still thinking on what would be the best approach for that runtime feature.
    The mask brush thing is a great idea, it sounds complicated though. I'll look into it and see what I can do ;)
    Would be cool to paint meshes in with some kind of noisy brush :O
     
  23. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Hey guys, it's been a while since my last update ;)
    How's it going?

    I just submitted MeshBrush V1.15 to the store.
    I added a brand new Slope Influence slider which allows you to control how much (in percentage) the rotations of painted meshes are influenced by their underlying surface normals (a value of 0% for instance would keep your painted meshes upright at all times, whereas a slope influence of 100% would align your painted meshes to be perfectly perpendicular to their underlying surfaces, which is what we already had before in the previous version of MeshBrush :D)

    I also added two new toggles to the inspector to optionally invert the Y-Axis of your painted meshes and a Y-Axis Tangent toggle, which aligns all the painted meshes to be tangent to their underlying surface instead of perfectly upright when the slope influence value is low.

    I am still programming for the API feature and the preset grouping system that got requested some time ago. It's quite tough actually to find something that is really easy to use and understand AND be efficient at the same time... But I'll figure something out, don't worry ;)

    As always: let me know what you guys think and if you have any bug reports, suggestions or feedbacks feel free to leave a comment here or contact me via e-mail :)
     
  24. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Hi raphu, this seems like a very useful tool. But I have one question before buying it, is it possible to add meshes to the Unity terrain using MeshBrush?
     
  25. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Yes, it is ;)
     
  26. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Great tool, very very helpful :)

    Maybe you could add a function to delete all objects (previously set with MeshBrush) within the circle?

    I use the tool to place low poly trees on the terrain. The problem is that I have to set the rotation of the trees to 0,0,0 after placing them. I will probably add an option to "freeze" the rotation, only for my needs :)
     
  27. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Thanks for the feedback, I'm really happy you're liking it :D
    Yeah, I was thinking about something similar too. I'll look into it once the current update (V1.15) gets accepted by the asset store team ;)

    PS: would you mind explaining me what you meant with "freezing" the rotation of your meshes at 0,0,0? Just being curious... :)
     
  28. FranckS

    FranckS

    Joined:
    Jan 14, 2014
    Posts:
    29
    Just bought your tool and it's really nice.

    One thing bothers me though, it looks like when Combine mesh is used on a collection of light mapped objects with a custom shader, it breaks up the reference to the lightmap (the UVs unity sends to the custom shader seem to be overlaping or something).

    Any idea?
     
  29. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Yeah... I kind of expected that :/

    I was struggling with that a month ago too together with my friend, didn't find a workaround yet. The thing with combine meshes is that you actually delete the meshes you painted and create a fresh, single, merged mesh for each material used... which in fact seems to scrap those references.
    But custom shaders can be soooo custom (if you know what I mean). There are TONS of things one could possibly do with shaders that would break MeshBrush's combining function (or viceversa).........

    I hope I find a sexy solution to this soon (and I'm still laying out some user-friendly ideas for the @runtime MeshBrush functionality), but I'm afraid I won't be releasing something till this summer... I'm currently moving to Basel and I don't have much time for game dev and the maintenance of MeshBrush.

    Sorry for the bummer :/
     
  30. FranckS

    FranckS

    Joined:
    Jan 14, 2014
    Posts:
    29
    Quote from one Unity guy: If meshes are statically batched, their UVs need to be pre-multiplied by the lightmap scale and offset.

    These are stored on a per instance apparently. I only have one lightmap, so no need to factor the map index in my case.

    I'm new to Unity and trying to figure out how all these things work right now :)

    As for my custom shader, I'm accessing the lightmap this way, pretty straightforward:

    Code (CSharp):
    1. float2 lightMapUV= ((i.UV.zw * unity_LightmapST.xy) + unity_LightmapST.zw);
    2. half3 direct = DecodeLightmap(tex2D(unity_Lightmap, lightMapUV)) * _Sun;
    i.UV.zw being my 2nd UV set

    Franck.
     
  31. FranckS

    FranckS

    Joined:
    Jan 14, 2014
    Posts:
    29
    May I suggest a couple features for a future revision of your tool:
    • A minimum distance param: when scattering, this would avoid some meshes being too close to another (or sometimes on top of each other).
    • A slope filter param: reduces the probability of an instance being created on steep slopes.
    • A sampling radius and number of rays for averaging snapping position of instances on uneven surfaces where sometimes the ray caster misses the actual surface and buries the instance.
    • And a snap to highest option when sampling with more than one ray
    Franck.
     
    Last edited: Jun 12, 2014
  32. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Long time no see guys,

    I have great news: MeshBrush 1.2 is getting ready and will be submitted to the store in approximately 2 weeks (and it's gonna be a huge update).
    I'll upload a release notes video in which I will describe how each of the new features work in detail and what has changed in general, and eventually discuss some workflow technique suggestions :)

    Have a nice one and greetings from Switzerland :D

    -Raphael
     
    FranckS likes this.
  33. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Alright people, MeshBrush 1.2 is now submitted and pending review.
    In the meantime, you can watch this documentation/tutorial video I made to get an idea of what changes and additions the update will bring (and how to use all of its new functionalities as soon as it comes out).

     
  34. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    YISS!!! Right in time :D

    MeshBrush version 1.2 now available!!! The intro/tutorial video about the runtime functionality is coming in a few days, don't worry ;)

    Have a nice August everyone, cheers!
     
  35. FranckS

    FranckS

    Joined:
    Jan 14, 2014
    Posts:
    29
    Awesome ! Keep up the good work :)
     
  36. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    K done, sorry for the delay guys... But here it is :D

    A video dedicated only to the new runtime feature.
    In it, I discuss the code and structure of this small API I created for MeshBrush and one example on how to use and implement it... although as you will notice there are many different possible approaches.

    Thanks to all of you for the awesome support you have given me the past months. Without this awesome Unity Forum community, I never would've been motivated enough to continue developing MeshBrush to what it is today :)

    So thanks a lot, and have a great time developing!

    PS: Summer's almost over and immah still waitin' here for the new GUI... C'mon Unity, my vacation's almost depleted... I need your stuff XD

    Let's hope it'll be as awesome as I think it is :p

    So anyway, here's the vid... Enjoy :)

     
  37. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    Hey raphu604, congrates on the fantastic project! Such simple and beautifuly coded work! Props on the api as well, I too may get to useing this in a built in level editor.

    I have a few segestions to put here in case you update this again. One I already implimented myself (as it was very simple) and I'd be happy to give you the work I did, although I'm sure you could find the bits and bang it out in 2 mins. Up to you? The feature is to add "Y axis points away from terrain pivot point" so that when painting trees, ect, onto a spherical planet, they all face away from the planet (or some degree depending on the slope from the pivot).

    The other thoughts I had were allready segested above but I'll bump them just to lend my support.

    #1: In order of desire I would like the ability to make sure meshes are not placed too close to other meshes in the group. I get alot of overlap and it makes my forest look less full then it might look if things were spaced out.

    #2: Delete meshs from brush area.


    The last one is a total pipe dream I imagine... But what the hey. I'd love for the ability to use the mesh combine option and somehow combine it with my LOD meshes. I have 3 LOD's for each type of tree, they all run with the QuickLOD asset. It would be pretty neat if I could combine the meshes of all the objects with all the different LOD levels. Honestly, this is probably not a very good idea... or is it? I donno, I'm still so green.


    Thanks again! My favorite buy on the asset store so far! I really hope you release more!
     
  38. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    Oh, one more thing.. after placing >5000-10000 or so meshes, the editor has a tendancy to stall for minutes at a time anytime I try to move the meshes from the parent or bulk change properties or anything. Do you have any idea on how to avoid this?
     
  39. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Thank you so much for the nice words, and for the suggestions too. I'm really happy you like it :)

    Hm, the pivot thing is a good idea, it's probably a matter of a few minutes implementing that (there would be an "override origin pivot" field or something like that, along with a toggle that switches the offset from the custom pivot on and off.

    #1: Yeah, I actually did notice that myself, although I remember when I was messing around with this problem in summer there was the huge performance drop when Physics.OverlapSphereing all painted meshes from each other (especially when having big brushes with many meshes in the paint set).
    And problem number 2 would be: what if developers decided to paint GameObjects without colliders at all (like grass, bushes, etc...). There is no way of detecting them inside the area other than perhaps tagging them with a component, but calling GetComponent on each painted mesh, comparing the distance around each one, etc... could be heavy too :/

    I promise I will look into a nifty solution soon, but I have to think about it carefully.

    #2: Yup, that should be available in the next update. :)

    About the editor's stalling issues: maybe splitting your painting sets into multiple groups could help (you could combine them every now and then, or if you don't want that you can grab them all once you see they are too many and extract them from the hierarchy and put them elsewhere). I think I'll add a feature to name your painted mesh holders in 1.3.

    Thanks again for your feedback and enjoy painting meshes and developing your game :D

    -Raphael
     
  40. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    Lol! Yeah, that was a duh moment... save them out more often! Hmm.. I was thinking it was by simple having so many objects in the scene. I'll test that.

    As for the pivot point, I think you may have misunderstood me. I didn't need an offset pivot (to the object being painted or painted on) I just needed a way to have the objects being painted (the trees) to be fully perpendicular to the pivot of the object I was painting on (the planet). As your code always has either the global y axis as up or the normal as up, I needed to roll my own addition that makes this up:

    Code (CSharp):
    1. paintedMeshTransform.transform.position - scHit.transform.position).normalized
    Thus I ended up with an additional check box that enables this code:

    Code (CSharp):
    1.  if (_mp.yAxisIsTangent)
    2.                 paintedMeshTransform.up = Vector3.Lerp(paintedMeshTransform.up, paintedMeshTransform.forward, _mp.slopeInfluence * 0.01f);
    3.             else if (_mp.yAxisIsPivot)  //<- Here is the additional bool to select Yaxis from pivot
    4.                 paintedMeshTransform.up = Vector3.Lerp((paintedMeshTransform.transform.position - scHit.transform.position).normalized, paintedMeshTransform.forward, _mp.slopeInfluence * 0.01f);
    5.             else
    6.                 paintedMeshTransform.up = Vector3.Lerp(Vector3.up, paintedMeshTransform.forward, _mp.slopeInfluence * 0.01f);
    7.            
    8.            
    I added the (_mp.yAxisIsPivot) for my alternative 'up'
    Works just fine but it gets overriden by the pervious check box (_mp.yAxisIsTangent)


    Anyway, good luck with your seatch for a more eligant solution to the overlap! I'm really happy with this all and I'm quite stoked it's so well written and commented so I can tweak things to my own needs! Cheers, sean
     
  41. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Ooh now I see :D
    Hey that makes me so happy to see people appriciating my code and actually extending it like that. It was exactly the kind of usage I was looking for over time :)
    Thanks again for the nice words and good luck with your project!

    Cheers,

    Raphael
     
  42. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    Hey Raphael, Sean again. I'm running into some difficulties and I'm wondering if you might have any ideas. I've noticed that the meshes I'm instanciating are being scaled even though I've set scaling to 0. So, instead of 1,1,1 for scale I'm getting 1,0.99999998,0.9999999 and then 0.9999996,1,1 ect ect... all off by just a little bit and all different. This seems to be harming dynamic batching as well as (i'm hoping / bug shooting my game) other things. I've tested with just cubes in a fresh project and confirmed this is a bug? Super frustrating, as I think I've commented out everything to do with scale and it's still happening... :( mega sad face

    Edit#1: Some sleuthing has told me that this is due to asigning the parent. When it gets asigned it changes the scale of the child. Tested and confirmed but I'm having trouble finding a workaround.


    Also, do you have any idea where I should start looking to try and make it so that the prefab connection doesn't get broken? It would be really nice to be able to edit the instanciated object as a group, a la proper prefab stylez.

    Annnd, sorry if I'm being picky today, I reeeaaally sugest you work on consolidating your code and getting rid of all the redundancy. With the runtime api now, there is 4(?) places used to paint the meshes that all do almost the exact same thing, so if I want to change something I need to change it in 4 places every time. I think one way to fix this would be to use the runtime api only and make the editor script only a wraper for the api. Also, it would be nice to combine alot of the PaintSingleMesh() and PaintMultipleMesh()... I can see some of the reasons for having them seperate but I think it could be worked out.

    Sorry, I'm just finicky about that. Great work on the comenting makes up for it right now.. :D
     
    Last edited: Nov 7, 2014
  43. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Hi Sean :)

    may I ask if you are using some sort of beta? I noticed this bug too, it started happening when I installed Unity 4.6 beta20, and the bug persists now with the new beta 5.0.0.9b :/

    And about the code:
    I really plan to clean up even more the code in 1.3, but I will probably leave the main structure like it is. People have been telling me recently that they feel comfortable with how MeshBrush's API is structured (and I was happy to see more people looking into extending my plugin... Always makes me happy :)).
    What I might look into though is merging single and multiple mesh paint methods (although there is a reason why I had split them in the first place). We'll see ;)

    And about the bug again: I'm workin' on it... I have no clue why this is happening (and especially why it didn't happen before), because I tested MeshBrush on different versions of Unity (and 2 of my friends did the same) before releasing 1.2, and we've never noticed anything quite like this.

    About the prefab connection: can you explain that problem further? I remember noticing something in regards of prefabs back in summer and I remember sitting there and meditating with a beer after an hour of research about the fact that it was not my fault, but Unity's way of handling prefabs. Maybe U5's nested prefabs will give me some room for further updates and interesting features in MeshBrush 1.3?

    What I also will do in 1.3 is use SerializedProperty in the inspector for handling Undos.

    Thanks for your feedback and merry game dev :>

    Raphael
     
  44. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    Heya Raphael! Thanks for the quick replys! I was getting so frustrated with a bunch of things, but your assest is not the reason... So thanks for letting me vent about all the scary bugs :)

    So I looked further into the 0.999999 error. It seems like it might have to do with 'floating point precision' problems... It's very strange if this didn't happen before beta 4.6 (yes I'm using 4.6) tho, as that seems to
    go agaisnt the idea that floating point is the reason.


    As for the broken prefab connection. I figured that out myself :)
    Here is the function for instanciating a prefab from editor with the prefab connection intact:
    (this one from the paintmulti function)

    Code (CSharp):
    1. paintedMesh = PrefabUtility.InstantiatePrefab(_mp.setOfMeshesToPaint[randomValueInArray]) as GameObject;
    2.  
    3. paintedMeshTransform = paintedMesh.transform;
    4. paintedMeshTransform.position = brHit.point;
    5.  
    Now, when I instanciate a bunch of trees, I can change their properties all in one go by changing the prefab they are attached to!

    Thanks again!
     
  45. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    Oh cool, thanks for figuring that out. Didn't know of the existance of that PrefabUtility class :O

    Cheers and have a nice weekend ;)
     
  46. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    @raphu604 i'm looking for an asset for my 2D game. I have completely flat fbx models created in blender. What i want to do is paint color at their edges. Can this asset do it? does it require colliders?
     
  47. GlitchedPolygons

    GlitchedPolygons

    Joined:
    Jun 18, 2013
    Posts:
    210
    I'm sorry, but with MeshBrush you can only place your meshes in the scene (with a highly customizable brush tho). There is no feature to actually paint color onto texture maps, sorry :/
     
    SanSolo likes this.
  48. kinnik

    kinnik

    Joined:
    Sep 6, 2014
    Posts:
    17
    @SanSolo: Hi! I've researched this before and I believe what your looking for is called painting 'vertex colors'. This lets you assign a color to each vertex on a model. It's usualy used to mix textures on or light a model (vertex lighting) but it can also be used to color. You would need a 'vertex color painting tool' (there are several free ones for Unity) and you'd need a shader that uses vertex coloring to see it on the model. Search a bit on google and if you think it'll work for what your doing but can't find the right free tool or shader, pm me and I'll send you the ones I'm using. :)

    @Raphael: If you'd like to add texture and color painting to your asset, I'd love to help! I have example code that could be learned from and adapted. It would be kinda neat to paint both foliage and ground textures in one pass ;p Allthough, being able to delete with the brush seems a priority for me. I hate going in and deleting trees to make room for roads
     
    SanSolo and GlitchedPolygons like this.
  49. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    @kinnik thanks i'll look into it :)
     
  50. Gooseman_1977

    Gooseman_1977

    Joined:
    Aug 15, 2013
    Posts:
    89
    Hi Raphael. I just picked up your plugin and I love it. HUGE time saver. I love all the options that it has. I just have one question, when I click "Combine painted mesh", is it creating a new mesh ? This will cost more memory instead of instancing cloned gameobjects because the game will now have to load a big mesh.