PDA

View Full Version : blowing up an old master painting


dougie0047
08-16-2008, 02:20 AM
Edit: The previous message is listed underneath, and I have edited it because I thought of what I believe is a better solution. So: How can I colour particles at creation using the colours of a file texture?
I'm thinking that if I map the filetexture onto a NURBS surface, and then sample the colour at any given UV coord., it should be possible to assign that specific colour to the particle that gets created at this particular UV coord., right? In other words, if the texture is a portrait, then all particles that gets generated where the face is gets skincoloured, the particles further up gets hair colours etc. But, how do I do this? Can I somehow use the sampler info node for example? Or is there perhaps a much easier way to "transfer" colour values from a file texture to particles?


(ok. So I have done some learning, and figured out how I can connect springs between particles and create interesting dynamic motions. The next step is what I really want to do.
I would like to set up a particle system (grid presumably) that in frame 1 just shows an image of a painting, all "intact". Then, I will shoot particles at it from behind, that will connect to the "Painting_particles" via springs and blow it apart creating some sort of floating cloud or blob or similar. The original painting will be cut into many little pieces more or less in the fashion shown in the attached image. the overlap is because I want to use a falloff in transparency, so that I can create a better looking "cloud/blob".There are several issues that I need help with in case some of you would be so kind to help.
1: How do I, for the start of the animation, arrange all the little images in such a way that staticly they show the painting as it is originally?
2:When the springs are created I guess there will be particles that will not get any springconnections. How can I cause these particular particles to fade in transparency quickly, and then kill them?
3:What would be really cool, would be if there is a way to direct the dynamic paint blob towards a goal, and there have the painting reconstitute itself again, so that at the end of the animation one only sees the painting as a whole. Or even cooler, to have the painting morph during the simulation, and then become another painting in the end.
Unfortunately I don't have much knowledge in scripting or programming, so detailed explanations would make me really happy. And, is this even possible the way I have explained it?)


Thanks!
Dougie

archemedes
08-17-2008, 05:31 AM
Hey, I did something similar to this today. Basically you want to turn your painting into particles and use dynamics to control it. There is a tutorial in the maya help files. Do a search for 'use a texture to color emission or scale the rate' this should set it up for you. One thing extra to do is when you have your particles emitting you will want them to be still so you can apply dynamics, you can do this by turning 'Conserve' to 0 in the attribute editor of your particle shape.
Cheers

dougie0047
08-17-2008, 12:21 PM
Thanks for your reply archemedes!

As luck would have it I finally stumbled on the right solution myself late last night, after hours of clicking all possible optionboxes and searching the helpfiles. And, you are absolutely right with your suggestion to the help files. So, there was an easier solution after all, which is brilliant! Now I can start playing :-)

btw. to keep the particles in place you can also just set their speed on emission to 0. Then, if you need, like me, to have them form the image of your file texture, just let the emission go on for a while, untill you're happy with what you've got, and then under Solvers, set initial state for selected (remember to then turn off emission).

My only worry now is that in order to have the painting end up without any holes in it (the entire surface covered in particles) I end up with too many particles in the scene. But I guess that's not something that cannot be solved.

Thanks again!

Dougie

Als
08-17-2008, 03:56 PM
Thanks for your reply archemedes!
My only worry now is that in order to have the painting end up without any holes in it (the entire surface covered in particles) I end up with too many particles in the scene. But I guess that's not something that cannot be solved.
Thanks again!
Dougie

Yes, it can. You need to control your emissions. If you use nurbsPlane you can tell every particle where to go. Depens if you want to move them or not. Other way is to emit from points, so you need just very densed polygon plane, like a grid. You can also make really dense mesh and convert it to particles with soft body. I'm not giving the solution, just few ideas for you to explore...


Als

dougie0047
08-17-2008, 10:27 PM
Sorry Als, my mistake - bad sentence. I wrote "not something that cannot be solved", but I guess it would have been much better if I had just written "something that can be solved" :-)
Yes I know I must be controlling my emissions, and controlling the rate of, and amount of, particles is not a problem at all. The problem lies in getting the whole plane covered by particles.
So, I get interested when you say that I can control (with NURBS) were every particle goes, which should mean that there are ways of covering the entire surface fast, with as few particles as possible, right? I assume one way would be to not emit a particle from the same point twice, at least until the entire surface have been covered. Perhaps there is a way to emit with as even a distribution as possible? Expressions anyone?
If I emit from a dense polyplane mesh will it emit from every single point everytime?

thanks for your reply Als, it gets me thinking...

Dougie

ctp
08-18-2008, 07:22 AM
For your edit of your first question: select your emitter, open the attribute editor, find the emitter tab, scroll down to the bottom and open the "Texture Emission Attributes" section. There you can pipe a texture into "particle color" and check the "inherit color" checkbox.

For even distribution, like Als said, you could create a poly plane, make the mesh very dense with a lot of subdivisions in height and width. Select the plane and go to Particles > Emit from Object. Choose an Omni or Directional emitter and set speeds to 0. That will emit particles exactly where the vertices are.
Next you could limit the amount of particles by looking in the attribute editor and on the particleShape set the "Max Count", which by default is set as -1. So set it to the same number as your number of vertices, and you will have a particle pr vertice when the emission has run long enough. Boosting the emission rate would speed that up and not overshoot the amount.

So the two suggestions above should be done in opposite order, sort of :-)

EDIT: forgot to mention, you need to have added the rgbPP attribute for the particles for the colors to come through. In the attribute editor go to the particleShape, go to the "Add Dynamic Attributes" section and hit the "Color" button, check "Add per particle attribute" and hit the "add attribute" button.

dougie0047
08-18-2008, 04:50 PM
thanks for your reply ctp!

as said in my second post of this thread, I've figured out the solution you're mentioning, but I'll give it a try to use a dense polymesh instead of a nurbs plane, to see if this yields better results.

One more thing: I've created springs between these particles and the particles of another particle node, and I have a question about that: how is it that I get better results (less "freaking out" of the springs etc.) with using an oversampling rate of 2 vs. 3 or 4?

Thanks again

Dougie

ctp
08-18-2008, 04:58 PM
ah yes, you did say! Didn't read thoroughly enough :D
As for the oversampling part... well that is curious! Don't have much to offer there.

Cheers, C

Als
08-19-2008, 01:22 PM
Lower the value of particles conserve, from 1 to something like .95, for measure, and tune it where you need it...


Als

dougie0047
08-20-2008, 12:10 AM
Lower the value of particles conserve, from 1 to something like .95, for measure, and tune it where you need it...Als

So Als... do you mean in order to control the behaviour of the springs? To make them not freak out so much, or have I misunderstood? If this works, what will then be the best way of keeping the momentum of the particles going, even with conserve set to .95 or so? Goals perhaps??

Dougie

Als
08-20-2008, 12:37 PM
You could try adding another spring with different density, or even type, and less strenght.
This works nice for softbody cloth simulation as well.
You could also apply drag field to slow particles down.
Also you can use newton field with per vertex on, with not so high values, if you wish for particles to be attracted to each other...

Hope this helps

Als

dougie0047
08-21-2008, 08:53 AM
thanks again Als! Sounds like good advice. I'll give that a try.

Also, how can I set rgbPP attributes with software render particles, like blobby surface? I know that the Particle Sampler Info node has something to do with it, but not really how to take advantage of that node...

Dougie

Als
08-21-2008, 01:00 PM
Open hypershade, create maya nodes -> particle utilities -> particle sampler info.

Or in mel (just in case):

shadingNode -asUtility particleSamplerInfo;


Then create material, for example blinn, assign it to particles, and it work area drag and drop particleSamplerInfo to a blinn, and it will connect automatically outcolor to color:


connectAttr -force particleSamplerInfo1.outColor blinn1.color;


If you keep your hypershade open while assinging new material, it will automatically add it into the work area. Also if you select particles, then create new material, it will automatically assign it to the selected object ie. particles.

To make colors work, (I guess you want every blob to have "different" color), you need to create rgbPP for particle shape, which you do by selecting particle shape in attribute editor, then open add dynamic attributes -> color -> add color per particle
Make some creation expression for colors, like most crazy one:

particleShape1.rgbPP=sphrand(1)


To make some nuances you add some value to color ( which is like R0 G.5 B0,
and we make it a vector, and then add it to random value.

particleShape1.rgbPP=sphrand(.4) + << 0, .5, 0 >>

If you want just to change one of the channels (R, G, B) you can do something like
(for green):

particleShape1.rgbPP= << 0, .5 + rand(-.2,.2), 0 >>

And you get nice greens.
You can pipe all sorts of stuff from particle sampler into materials. Like velocity etc.
Experiment!


Als

dougie0047
08-24-2008, 02:18 AM
Thanks for your comments Als! They are really very helpful. Especially because you've added the code. So I learn even more :-)

I have another question though (never stop having them :)...

Obviously I've learned how to emit particles from textures by now, but is there a way one could "reverse" that? What I mean is: is it possible to not only have particles spawned by textures, but also "attracted" to them, so you could for example have particles jumping from one texture image to another?

I believe you could use goals to guide the particles towards, say, another plane, but is it also possible to have them for example collide with only the white areas of a texture, and have them avoid the dark areas (not only just pass through, but actually physically avoid certain areas)?

thanks!

Dougie

Als
09-09-2008, 07:00 PM
Well if you have particles which got the color from the texture, you can use create a field, and use particles as a source on field, then switch on vertex option in the field.
Depending on which field you use, but you can try newton, and use particle mass as a strenght factor.

Al

dougie0047
09-10-2008, 03:48 PM
thanks again Als! I'll try that out, but first I will have to read some help files to understand better :-)

Dougie

Als
09-10-2008, 06:12 PM
You can use particles as a source for field.

Here is tutorial from Jared Martin who explains this:

http://www.highend3d.com/maya/tutorials/dynamics_fx/Maya-Dynamics---Interparticle-Collisions-213.html

Hope this helps


Al

EightBit
09-10-2008, 09:27 PM
I recently needed to accomplish a similar task so I've been following this thread. When it comes to getting the particles to move, you can simply assign random weights, setup a field or two, and let 'em go.
http://forums.cgsociety.org/showthread.php?p=5352531#post5352531

dougie0047
09-11-2008, 08:11 PM
thanks guys. I'll go through both the tutorial and your thread, EightBit, later. So much to learn... :-)

Dougie

CGTalk Moderation
09-11-2008, 08:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.