Here’s the effect I’d like to get in maya, anyone have any tips getting there? I’d like an object to be able to dynamically paint another object with a color. I know there must be a way to do this with fluidtexture2d, but I need a little help figuring it out.
Sorry, I should of been a little more clear on the full scope of my project.
But I’d need to draw on 3D surfaces as well, a sphere for example. How would I go about doing this? As I understand a fluidtexture2d is limited to flat surfaces when using fluid emitters.
You could emit particles from your brush and collide them with the object. Then in the particle runtime expression get the uv position of the object on collision, kill the particle and use setFluidAttr to add the color/density to the 2d fluid texture at that uv. I once wrote an expression that did this, but I can’t seem to find it at the moment.
An easier method is just to use a fluidTexture3d and use normal emission into that, but this will use more memory and might not be practical if you need high resolution.
So I’ve actually tried this based on some research I did that you had suggested to someone else a while ago using this mel script you made (This may actually be what you were mentioning):
I’ve encounter two issues though, maybe you could help me resolve them.
Since the object that the particles are colliding with need to be set as a collision object, the particles get pushed back when they make contact with the with it, also I can only seem to make the particles color the exact place of collision, and as they move across the surface the stop emitting color.
tldr: Partciles mush together when they make contact, and don’t create a trail. Here’s an example from my .mb file (The texture maps aren’t setup right, but it should get the point across) https://youtu.be/FcofgevtCro
Instead I would emit particles continuously. Give them a short life and set lifespanPP to -1 on collide to kill them:
if (nParticleShape1.collisionGeometryIndex != -1){
lifespanPP = -1;
//… do the fluid emission stuff
}
Did you create the attribute collisionGeometryIndex? (in the add attribute window under particle) Although you could probably also just check the collisionU !=-1 instead.
That resolved the issue of me saving the script… but sadly I’m still having the same issues with the particles not going away and them not creating a streak.
As far as the lack of trail goes, is there any way I can force the particles to attract to the surface? It seems like the lack of streaking is because they are bouncing off once they hit the collision and sort of hover above it even though conserve is set to 0. Gravity would work here, but it wouldn’t be a solution for my project because that wouldn’t work on a wall on its side or up above.
You need to first set the lifespan to lifespanMode to lifespanPP, then in the create expression you can set lifespanPP to something short, like:
lifespanPP = 0.2;
If anyone has any suggestions to get things a little more accurate I’m all ears. I’ll be tweaking this as I go along and hopefully be able to make it work much better moving forward.
looks good! To get rid of that jumpy emission use the fill option for your emitter to use the entire volume of the sphere to emit and turn off jitter. After seeing this ill think ill make one of these myself very useful workflow.
Yes, on the particle emitter use surface emission, not omni. Then for a smooth emission increase the particles emitted from the sphere, and lower the density emitRate in your expression.
So I’ve been using this method a little more, but now I’m running into an error that is causing the Fluid Texture 2D to not show anything as the particles collide. When I apply a Fluid Texture 2D to a character model I have, I get the error returned once I begin to simulate the scene
I actually don’t know to much about UV and textures in general, this was just a model I had on my PC to run a quick test. Is there something specific I should make sure of on the UV settings in order to make sure things are accurate?
If there’s a resource out there that you’d recommend I’d be happy to check it out if it something hard to explain or requires a bit more research.
open window-> Uv Texture Editor with your mesh highlighted.
If your uvs are unique (all have their own uv coordinate) and are all contained within the upper right hand box your good to go. Im at work so I cant open your scene but if your still having issues i could check later.