nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.26k stars 233 forks source link

Maybe Blender Partice Instancer Bug, but .... #210

Closed enzyme69 closed 10 years ago

enzyme69 commented 10 years ago

I am making this setup for "procedural flipping". Previously I am using Drivers for this and measure the distance changes. Now I am doing it inside Sverchok.

So basically it is pretty simple:

  1. Start with template grid.
  2. I duplicate the template grid => this is for deformed grid
  3. I measure the original point position with the deformed grid
  4. On every point, I create Clones.
  5. For every Clones, I transform it based on the distance data.

The thing works perfectly in Sverchok. But supposed I want to have better efficiency, I need to use Instances.

So, I use BMesh Viewer to output the "flipping animation mesh", and then using this as template for Duplication for Particles Instances.

Now this is when I found a "bug".

Somewhat when flipping value goes under or beyond the norm, the resulting Instances is not pointing at anything. It just snap to a weird rotation.

I am not sure if this is Sverchok related or Blender Particles. I am afraid this is Blender Particle + Instancer bug, but it is going to be difficult for me to report this to Blender Developer. I will try anyway. I will ask them to look at this thread.

procedural_flip_with_bug

zeffii commented 10 years ago

my earliest implementation did not use selected_objects, so it didn't matter what context existed and worked at render-time. But then I changed it, .. may 10th, a month ago without testing how it would behave during render-time.

If we change it to what the snippet above proposes, then currently saved .blends can close blender when tried to open. Why? I don't know, it works fine with fresh blends. I've long suspected .blend stores a class reference to existing nodes and if the class on disk doesn't match it this can cause memory leak - and exits blender.

enzyme69 commented 10 years ago

besides the crashing bug, Wondering about why the instancer is facing and snapping to 22.5 degree angle?

zeffii commented 10 years ago

There are two issues here, that have nothing to do with the title of this Thread.

zeffii commented 10 years ago

I'm pretty sure the angle stuff is something unrelated to sverchok. Your second video shows that perhaps picking up existing bmesh created objects after delete+recreate BMeshViewer is a source of crash.

enzyme69 commented 10 years ago

Probably the crashing happens because I am trying to select the Ghost of BMesh object. hence why lock the selection was a good idea.

enzyme69 commented 10 years ago

ok, maybe the angle thing is not sverchok, in the future I will keep eyes on something similar. one day, we will be able to specifically affect the Point Normal using Sverchok :)

zeffii commented 10 years ago

i don't know what you mean by 'point normal' . images please.

zeffii commented 10 years ago

I'll make a mini Instancer node to test a theory.

enzyme69 commented 10 years ago

prtscr capture_12 prtscr capture_11

"Point Normal" is the term used in Houdini. Equivalent to Vertex Normal or Vertices Vector maybe.

The Face Normal is (always) the one facing up or down from the Face, but I was wondering if the Particle Instances or DupliFace going in 22.5 degree angle was because of the Mesh or Blender internal BMesh that does that. It's correctly pointing in a certain direction, but the Rotation of the Instance, how can we know the UP and AIM to align with the edges?

Yes, "Mini Instancer Node" should be cool with me.

Sverchok is somewhat similar to Softimage ICE actually. I never use ICE though.

In Houdini, the "context" is important:

I believe in Houdini point instancing is separated a node.

zeffii commented 10 years ago

I thought Blender recalculated Vertex Normals even if the users changes them, this has been a long debate between lowpoly modellers and Blender developers, low poly modellers want good vertex normal support to make shading faces more flexible with minimal geometry. Was custom Vertex Normals implemented? It might have, it's been a while since I followed that line of debate..

enzyme69 commented 10 years ago

Point normal in Blender is always averaged or locked? I don't know that will be for next conversation, I guess.

The crashing should not happen if I am not selecting the Bmesh, do you think that is a good explanation?

zeffii commented 10 years ago

nope, can't pinpoint it unless we either 'luck out' and happen to read a bit of code and think to ourselves 'thats probably wrong'. Or we can pinpoint it by consistently reproducing the steps to crash.

zeffii commented 10 years ago

but crashes points to memory access of objects that are removed or moved. Error messages are from heaven :)

enzyme69 commented 10 years ago

I found out about the crashing after I parent object to create Dupliface and start doing Instancing using the BMesh. Maybe they are related somewhat to the Instance Musing.

enzyme69 commented 10 years ago

Sometimes, I also leave the Playback running while BMesh Viewer is on so that the Sverchok update/refresh automatically.

I was trying to do procedural flipping. So the flip is working fine, the BMesh crashess when trying to render the animation or the DupliFace. So they must be related.

enzyme69 commented 10 years ago

And at one point, the BMesh animation alone crashes Blender without the DupliFrame.

Probably the solution is to "bake" the BMesh instead of rendering while the BMesh is baking.

zeffii commented 10 years ago

OK, for the time being don't do dupliFacing or anything but 'viewing' geometry from the BMesh Viewer. Think of the meshes that BMesh viewer currently outputs as 'in flux' or 'transient' per framechange or update event. If you assign some Blender 'thing' to a BMeshView generated object you "gonna have a bad time"_. :D It is simply not designed with that in mind.

If you can pinpoint bugs which are in no way related to using the output of BMeshViewer in that way, then i'm definitely interested to hear those.

EDIT: but I totally see why you want to use it that way.

enzyme69 commented 10 years ago

prtscr capture_9

So far so good. I even manage to use BMesh as Retopology tool that uses ShrinkWrap Modifier into heavy mesh.

When using BMesh with same Name, I need to be careful not to override the other. But thanks for having option to randomize the name.

Cheers also for option to Group and Select/Deselect.

I supposed we can close this one for now.