nCloth Leaves wind?


#1

Hi, looking for some advice on simulating leaves with nCloth. Ive got about 100k leaves as one poly obj that isnt connected to branches or anything, and im trying to add motion to them with nCloth. Im sort of struggling with getting them to stay where they are while still having motion.

Currently im using input mesh attract set to .5 to keep them in place, and using nucleus wind with a noise expression on wind speed to add gusts and keep them moving, coupled with a turbulence field.
They wobble and move a lot to for first 50 frames but then settle and almost stop, assuming because of mesh attract holding them back? Tried adding noise expression to input mesh attract to let them relax and tense but when hitting play nothing happens, no simulation, no idea why.
Another possibility is component-component constraint.
Anyone have any ideas, or know of a better way to keep them in place but let them move freely?
Thanks


#2

Does anyone have any ideas on this? Apologies for the shameless self bump, but im proper stuck. Incase the post wasnt very clear, im trying to hold nCloth in position while letting it move in place with turbulence. Ta


#3

Perhaps this will help:
http://area.autodesk.com/blogs/duncan/falling_leaves_with_ncloth_and_paint_effects

Also if you are using input attract, make sure the input attract value is mapped so that only u values near zero are white and the rest black( no input attract).

Duncan


#4

Thanks for the reply Duncan :slight_smile:
Ive read your blog, and tried the component-component with distance to hold them, but didnt like how it played with my leaves.

Also if you are using input attract, make sure the input attract value is mapped so that only u values near zero are white and the rest black( no input attract).

Ive tried mapping a ramp (set to U) to input mesh attract, and if i make a white value near zero and have gradation to black, input mesh attract stays the value of the white, theres no gradation on input mesh attract itself.
I also tried using an expression to increase and decrease input mesh attract, and while the values changed, the simulation stood still like it was at 1. That was until i made a new nCloth with space set to world instead of local, and the input mesh attract succesfully alters the simulation. But i dont get why the expression altering input mesh attract would work on one but not another?
I looked it up in help documents but i didnt fully understand. It also said local gave the best most predictable results :confused: Any chance you could clear this up for me? Thanks a bunch


#5

I did a quick test(see attached scene), and it seems one needs a v ramp, not a u ramp.

Also I set the input attract method to locking so that the ramp values of 1 act as a weld constraint. The tree in the simulation is a simple oak brush converted to poly with the leaves turned into nCloth and constrained with inputAttract that is mapped with a vRamp. I added a little wind on the nucleus node to make the leaves flutter (the lift/drag/windspeed settings are important for the right effect) then added some turbulence on the brush to make the branches move.

I’m not sure why using the worldspace nCloth setup would help you, unless perhaps you were animating the wrong mesh… for example adding a deformer to the output cloth mesh instead of the input one.


#6

Hi Duncan, thanks a bunch for the reply, much appreciated.
Unfortunatley im not able to open the file properly. Was it saved in 14? as im still in 13. I could open it, but with errors so couldnt study it properly. But i think i can guess what you mean from your post;
you map v ramp going from black to white(or visa versa) to the input mesh attract. and turn locking on so values of 1 behave as a weld. So this ramp is working for each leaf.
However when i try to recreate it, mapping the ramp to inputmesh attract, its either 1 or 0 (dependant on if black or white is first in the ramp) I can get no 0 to 1 its either on or off.

With regards to writing an expression on input mesh attract, i was using no deformers on output. Just a really simple noise expression on input mesh attract, and got no movement? I must be doing something wrong as neither expression or ramp is having any effect.
Cheers


#7

Not sure why but it sounds like there is a problem with the uvs on leaves. What do you see if you assign a simple shader to the leaf mesh and map the color with a vramp?


#8

On the test scene, the uvs seem fine, shader looks like a standard ramp, but no motion. However on the actual scene issues will arise (even if i could get it to work) because im using a script to split the uvs for leaf variations.
But even if that wasnt the case i cant get it to work on either setup, mine or test scene.

Ive put together some scene files (really simple ones) wondering if you could just double check my setup?
https://drive.google.com/folderview?id=0B6VuTCkS6IxcNUc1UjA5bWVudkk&usp=sharing

The basic ones are using a small number of leaves from a pfx oak. (normal UVs)
Tried two ways:
ramp method, v ramp to input mesh A. - no effect
expression, expr to input mesh A. - small effect, but looks not so fab.

The full one is my actual setup (split UVs)
Neither method has any effect.

Would be very greatful if you could take a look and see where im going wrong? Its probably something really simple.
Cheers
(Edit: New link)


#9

Your problem is that you are mapping the inputAttract attribute. ( an understandable confusion )

Mapping of non-shading attributes is a bit different than for a normal texturing workflow. In general only 2d textures are supported and only certain attributes may be mapped. In the case of cloth attributes there are special attributes for mapping (open the dynamic properties maps in the attribute editor for the cloth shape). You need to map the inputAttractMap attribute.
With these cloth mappings the base attribute value (in this case inputAttract) becomes a multiplier of the overall texture value…so the the texture can stay in a 0-1 range.


#10

Thanks a bunch Duncan, its working now. Feel really silly, spent too long working with shaders i think.

To expand on the effect, i also wanted the leaves to peel away from left to right, but using textures, rather than constraints due to the number of leaves. What would be the best way to go about doing this?
I thought another ramp, but currently the ramp affects each leaf individually, what would be the best way to apply a ramp to the leaves object as a whole, while keeping the individual ramps per leaf? I guess i mean an input mesh override, maybe using a layered texture?
Or is there a better way to do this?
Cheers :slight_smile:


#11

Ive setup a method using two ramps and two uvSets, the original and one planar mapped. Using a layered texture to control the alpha between the two. Plugged it into the shader and looks fine, but the layered texture/shader node is letting me down, yet again. :hmm:
I get no motion when plugged into the inputMesh map. Tried exporting to image sequence, but i dont think this will work because of the two uvSets.
Maybe i could do a transfer map between the original and the the planar map uvSet, and export that way? Will keep trying.
Please find attatched scene file, just incase your know of way to get the layered texture to work as the inputMesh map.
leaves2.zip


#12

When using textures outside a shading sample context (i.e for dynamics) you can’t do things like map texture attributes with other textures or use layer nodes. The only thing (on top of the base texture attributes) that is currently supported is the texture placement node. I suppose you could bake down to a file texture an use that. You can paint file textures. Also instead you can paint per vertex values.

I’m not sure what you are trying to do, but perhaps a concentric ramp with animated texture placement might help.


#13

Thanks for the reply. Im trying to make the input mesh attract turn off over time from left to right, so the leaves can break away, as the shader demonstrates in the linked scene. Now i know to avoid layered textures, i will look in to using a texture placement with the ramp that is currently mapped to input mesh attract, just not sure how to layer black over the current black to white ramp, without the layered texture node. Guessing blend node wont work.
The issue is the UVs are for each leaf from black to white, for input mesh attract. This is correct, but i also need uvs for the leaves obj as a whole to overlay an animated black colour(on inputmeshAttract) that moves over the enitre object from left to right, whereas if i made an animated texture currently, each individual leaf would turn to black at the same time. Apologies if im overcomplicating something that should be basic. Will continue trying.
Thanks


#14

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.