Hey, the plugin will help you paint in world-space with Decal textures that can be rotated in any desired direction. It also offers a high-performance query system to tell you whether a world location has been painted within a certain radius. Erasing painted areas is supported. These are the only building blocks (no pun intended :)) you’ll be provided for your usecase.
To go from there to painting roads that snap/intersect/etc (while looking visually coherent) is a leap that will involve a fair amount of tinkering and trial. For example, to make the road decals snap you’d need to calculate the correct decal rotation angle yourself as the user is painting a road (by comparing the previous mouse location to current, etc) and you may also need various constraints to prevent things from getting messy if a player scribbles around.
Grass/rocks/etc that are painted can be erased, but if you’re talking about static meshes then removing those is something you’ll have to manage on your own.
Spline to Landscape Paint
I know at least one plugin user who is placing splines on landscapes and then using this plugin to automate painting along the spline.
Along those lines (did it again :)), instead of allowing free-form painting of roads if you could constrain your user’s input in some way (if not a spline, then along a grid like many city building games use) then you’d have narrowed the player’s input spectrum and made the overall usecase simpler.
Like I said I am loving this plugin, have its usage all coded up from scratch in my game… everything feels right about it. However, I had the same issue where you can’t paint on places on a skeletal mesh… I saw that you said this was a uv layer issue. Not knowing much about uv layers or channels I googled a video which took me through the creation of the 2nd uv map for lighting, made sure none of the packs were overlapping, reimported it, rebuilt the lighting. And now its even worse… like not only can i not paint on the same spots… around eyes and chest for example (with a small sized brush, if use a huge one it overlaps it all)… but now where I do paint… some of the vertices aren’t getting painted… so the attempt to make a second uv and import it, made the situation worse.
Ive been at it a couple days and its wearing me thin. Could you point me the right direction of how to set up the 2nd uv in blender, how to import it so it works… Hell I can’t even find any uv information on skeletal meshes, anything even showing that the 2nd uv map imported… and all the posts and videos i find about uvs are an intermediate level… for people who already know what I need to know.
Is there any kind of support (didn’t see any instructions in the knowledge base about it) or video showing how to setup a 2nd uv so you can paint everywhere on the skeletal mesh? Hell how does one even look at the uvs for a skeletal mesh in ue4? I saw in blender before I made the 2nd uv that there was only one, so I was like… hey… that’s probably why… but after exporting it… and reimporting it, it neither fixed it (made it worse) nor could I even find where to confirm the uvs are on a skeletal mesh.
Thanks for your time!
note: I also thought it was strange that my code uses the uv1 nodes in the material not uv0 but its still functioned somewhat well besides a few null spots even though i only had the 1 uv before I tried to make the 2nd one. Also note that the 2nd uv map i made had all the vertices and nothing overlapping and were decently spaced, so not sure why it didn’t work. At first I thought it was a collision issue, but the physics asset is setup well, and the debugs on the traces show hits.
Hey, if you open Persona and go to UV -> Show -> Advanced -> UV you can pick a UV channel to display.
For preparing UV1 simply take your UV0 channel and rework it so that all the mirrored parts (left arm / right arm / etc) are moved out to unique UV islands. So before if you had one single UV island for an entire arm or leg, now you would unwrap each arm separately resulting in two UV islands. If every vertex on the model occupies a unique spot on the UV you’re good to go. For Blender, even using the default Lightmap pack will give you something usable (but blotchy because it will create too many islands). Btw, my use of term “Lightmap UV” is a bit of a misnomer; “Paintmap UV” is probably a better term as what we’re doing has nothing to do with Lightmass (so you don’t need to rebuild lighting/etc for this to work).
If your physics asset tightly envelopes the character and the UV is also good then there’s something else going on here and it may have nothing to do with the UVs.
One good way to determine whether your skeletal mesh is the problem is to simply migrate the sample project’s demo character into your test project (and be sure to apply your character’s materials onto the demo character). If you’re able to paint on the demo character then we know it’s an issue with your skeletal mesh’s setup (could be UV or physics asset). Now if the demo character can’t be painted with your setup, then we have evidence of a basic setup issue in your character’s material and/or Paint BP / layer setup (in which case your mesh setup would probably be correct).
Let me know how this test goes and we can debug further based on the results
Thank your for your time! The spline-to-landscape painting, specifically for roads, is something I’ve been looking for for years but I haven’t found a lot of information on allowing the player to do so at runtime. This sounds in line with what I’ve been thinking and is probably the road I want to go down.
4.18 Morph Target issue update
— UE-54099 has been officially logged as an engine bug by Epic.
Please upvote this bug to indicate community interest if you’re affected by it or even if you plan to use morph targets in any capacity. That will help aid in quicker resolution
Thanks for the quick reply sorry for my delay in response. That was what I did in blender, I separated so each had its own island, was I supposed to name the new uv layer something specific? UV1? Also, I am not seeing a UV section at all in the persona.
I also, tested my material on the demo character in my setup as you suggested. I saw the same behaviour, while I was able to paint on any spot with a decent size brush when I made the brush real small the same issue happened, I was unable to paint on the chest area of the demo character. I tried the same thing in the sample project with nothing changed on the paint demo area and the same thing is kinda happening there but to a lesser extent, when the brush is real small it tends to not paint on some spots like the chest. This is worse on my skeletal mesh, happens on chest and around eye area and some other spots. I put your m balloon material instance from demo character on mine, and it does same thing exactly. So that rules out material setup, when brush is larger I can easily paint on the spots that are giving trouble, so I don’t think it the UV. I am getting collision on the sphere trace I’m using and its registering hits so I don’t think its the Physics asset. But I am using a sphere trace like you do, so color me confused. I could just limit the size of the brush to be a decent sized brush and all works fine, but I was hoping to use smaller brushes for detailed stuff like warpaint and makeup done manually. Really just as small as it is in the demo, but even there you see it happen a little when you try to paint the middle of the chest or parts of the antennae with the min brush size you allow in demo.
I would of quoted your response but for some reason the forums aren’t letting me quote lol… I am going to screw with it more, redo the 2nd uv again and try a few things. Thanks for your time and help, I appreciate it.
The smaller your brush size, the more accurate the supplied hit location (and therefore your collision) must be. This explains why increasing the brush size helps with your issue, it’s because the proximity test used by the brush (to determine whether a given pixel on your character should receive paint) succeeds and reaches the eyes at higher values, whereas at lower brush sizes the required proximity to those pixels was not attained.
With that background out of the way, for intricate sections like eyes there’s a few things you can try:
**Physics Asset Refinement **/ Per-Poly-Collision (for testing)
I’m not convinced that your physics asset is accurate enough to paint around the curvature of eyes, simply because it would take a significant amount of effort to jig a physics asset accurately enough to envelop such organic surfaces (for small brush sizes) just using the simple collision bodies that PhAT offers (sphere/capsule/etc).
For testing purposes first try per-poly collision (set in Persona) to achieve a baseline for the best kind of results you can expect. Then work your way up to a sufficiently accurate physics asset. Note:- In previous engine versions I’ve run into some bugs with enabling per-polly collision. I do not know if these have been fixed so before trying to paint first ensure that per poly collision is actually enabled. I’ve seen cases where collision simply disappears altogether.
UV refinement: After you’re satisfied with the physics asset, refine the UVs. There’s no issues with your UV setup (afaict), but there may be scope for refinement. First try to reduce the number of UV islands to just a few large contiguous ones. Especially around tiny areas like the head and eyes try to ensure that areas that likely to be painted occupy a large contiguous surface. The “Paintmap UV” (UV1/etc) is totally independent of your main UV0 so you can rework the paintmap any way you like without affecting your character’s regular texture work. Use this to your advantage to give extra resolution / coverage to desired areas.
To answer your question about UV naming convention, you can call it whatever you like in your modeling application. Ultimately the UV index and the paint node you choose (Don_Mesh_Paint_UV1/etc) are what matter. For finding the UV channel in Persona, see this screenshot:
[spoiler][/spoiler]
Texture Resolution
See this KB article on bumping up the texture resolution. With the other steps compete, it would be useful to know if you’re seeing any benefit from increasing resolution up to 2k (from the default 1k).
Awesome plugin, we are using it for impact effects to start with.
But I have found a problem on high latency(300-400 ping) servers. I am getting “Ensure condition failed: UnwrapperMaterialInstance” in the DonMeshPainterGlobalActor.
After some debugging it seems there is a race condition between the OnRep_ActivePainterComponents and BeginPlay. I have seen similar problems in my own project, you can’t use BeginPlay to do init stuff.
After moving the creation of material instances to “PreInitializeComponents” the error is gone.
Hope this can help you handle the error reports for this issue.
Just use a TwoSidedSign node and Lerp as desired. The value returned by the node indicates whether the current pixel being shaded is part of a backface or not, so you can use that information to selectively blacken out those. See the material function MF_SimpleCraterEffect that comes with the sample project for more (you should be able to load it whether or not you have the plugin…)
Tomorrow (13th) is the last day of the sale, just as a reminder!
If you’re wondering whether this plugin will be useful for your project be sure to check out the video trailer and online knowledge-base to learn why practically every single game/project stands to benefit from the plugin’s rich feature-set.
Hi Don, can it paint easily onto character meshes I got from the marketplace? It seems good for a damage system? Also does it work well with the sequencer? Thanks, looks like a great tool.
You’ll need to prepare a 2nd UV channel for the character meshes as described in these knowledge base articles - Character Painting FAQ, Preparing your Mesh for Painting. That means you will need to export your marketplace meshes to your 3D tool of choice and reimport them back after adding the 2nd UV channel. This step is not required if the first UV channel has no overlapping faces, though that is very rare.
Yes, that is one of the primary usecases for this plugin!
Runtime/in-game functionality is the main focus of the plugin, editor usage has not been tested/supported. I do know some plugin customers who found a way to run it in editor mode (with some tinkering) for landscape painting driven by splines, but as I have not personally tested this myself it is not an officially blessed feature.
Can you elaborate on your Sequencer usecase though? If it makes sense I may be interested in adding official editor-time usage support for a future update.
Thanks for your answers, they’re very helpful! An example of Sequencer usage would be painting during a cutscene - for example, a wall having a decal applied at a specific time so it looks like a character in the cutscene put it on the wall. Would something like that be possible? I think it would be a cool feature I understand from your videos that paint effects can be loaded back into memory, so it seems possible I think?
Yes, that would be a cool feature indeed! It is technically feasible via editor-support + save-load/etc (latter is already available as you noted) but it will take some time and effort to design this properly, so I can’t commit to this feature just yet… maybe for a future update depending on how easy it is to implement, but unconfirmed at this time…