7
$\begingroup$

When replacing sparse quads with a custom mesh, I create a "base vertex" on each quad, in order to cause a Particle Instance modifier to spawn the custom mesh at the right place (like for spawning leaves on a tree created by the Sapling addon).

However, when I delete the rest of the quad, just keeping the wanted vertex, its normal is modified, making the Particle Instance modifier instantiate the meshes with an incorrect rotation.

How can I keep the normal as it is (aligned to the quad's face) while removing the useless vertices?

here is an example blend file : http://www.pasteall.org/blend/23530

Goals:

  • new leaves must have the same orientation as the sapling one.
  • they must look natural : they must have their base touching the branches.
  • their must be exactly the same number of leaves in the particle instance modifier as in the sapling version.
$\endgroup$
  • 1
    $\begingroup$ By the way, Sapling doesn't use a particle system; it generates the leaves with Python. Also, the main tree is a curve, not a mesh, so it doesn't really carry over. $\endgroup$ – wchargin Aug 19 '13 at 15:18
  • $\begingroup$ I know sapling generates one mesh for all leaves with python. I want to replace them as described in blender.stackexchange.com/questions/1393/… ,but I want to keep the sapling orientation of the leaves. $\endgroup$ – matali Aug 19 '13 at 18:49
4
$\begingroup$

A single vertex can't have a normal vector. A normal is the vector which is perpendicular to two other vectors (edges) the normal is calculated using the cross product.

A vertex normal is the average of all surfaces normals which contain a certain vertex, this does not mean that a vertex can have a normal.

Perhaps you could move the original quads to another (invisible) layer.

$\endgroup$
  • $\begingroup$ But then, how can I tell the particle system to spawn the replacement meshes only on that particular vertex ? If I keep the quads, I'll have 5 new leaves per leaf as far as I know. $\endgroup$ – matali Aug 19 '13 at 18:46
  • $\begingroup$ @matali I haven't used a particle system this way, you could add your .blend file so that we could find a way. $\endgroup$ – stacker Aug 19 '13 at 20:20
  • $\begingroup$ I used vertex groups to only get one "new leaf per old leaf" and kept the quads for the orientation. The leaves are now in the right plane, touching the branch, the last missing thing is the "tangent orientation. I tried to use the tangent factor in particle system, however, it doesn't seems to work. Any Idea ? Should I start a new question as it more or less derive from the original one ? $\endgroup$ – matali Aug 23 '13 at 10:59
  • $\begingroup$ @matali It seems that you're better off to add another question which adresses the new issue. $\endgroup$ – stacker Aug 23 '13 at 11:16
1
$\begingroup$

Here is one way that get results similar to what I think you want:

  1. Set Particles/Face to 1. This will emit one particle per face, so you do not have to remove the extra vertices; you can keep the quad and so the normal as well.

    enter image description here

  2. Select all the faces in the original sapling mesh to see how many faces there are. enter image description here

  3. set the number of particles to equal the number of planes in the sapling mesh (11947)

It's a bit hard to tell how well they line up, but form a wire frame view you can see they are similar at the very least:

enter image description here

By adjusting the leaf mesh used in the Particle instance modifier slightly, you can make sure the end of the leaf is on the branch:

enter image description here


This is mostly an extension of my comment below, because you can't put images in comments.

The leaves as one object:

enter image description here

When you separate them, (P>Separate by loose parts and CtrlAltShiftC>Origin to geometry) the normals are still intact, but the object rotation is aligned to the world.

enter image description here

If you try to link them the vertices simply copy their relative positions without applying any object rotation afterward as there is none:

enter image description here

If you simply duplicate some planes around in Object mode, the object rotation is effected:

enter image description here

so now you can link (CtrlL> Object Data) them, and they will keep their individual orientation even as you edit one of them:

enter image description here

The one missing link is a python script to translate the normals into object rotation.

$\endgroup$
  • $\begingroup$ It somehow works for the normal orientation, but the rotation is wrong in my test (some leaves go down where they were going up, etc...) and they all appear at different offsets on the faces, making it impossible to make them all touch the branches. Although, some faces get 2 leaves and some 0, maybe because quads are in fact 2 triangle faces ? I know such problems won't be noticed for trees far away, but for those trees I don't even use a texture and I let the flat quads. What I'm doing is for front trees and precision is critical. Flying leaves aren't realistic at all. $\endgroup$ – matali Aug 21 '13 at 7:24
  • $\begingroup$ @matali I don't know enough about python to know if this would work, but I wonder if it might be possible to calculate what the object rotation should be based on the Normal? then you could use P>Separate by loose parts and use python to change the normals to object rotation. (then you could link them so editing one edits them all) $\endgroup$ – gandalf3 Aug 21 '13 at 17:30
  • $\begingroup$ Nice Idea, However, blender is pretty slow with 20000+ objects (most of my trees have more than 20000 leaves) which makes it impossible. I don't even speak of normal use cases where i have more than 1000s of trees. $\endgroup$ – matali Aug 23 '13 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.