Page 9 of 15

Re: Blender instances "patch" for the unofficial exporter

Posted: Sun Aug 05, 2012 6:07 am
by matej
face wrote:I think the last transformation you can“t do with matrixes...
If you mean shearing, you can:
shear.jpg
The original mesh is a cube

Re: Blender instances "patch" for the unofficial exporter

Posted: Sun Aug 05, 2012 8:06 am
by face
Ah ok, thanks.

face

Re: Blender instances "patch" for the unofficial exporter

Posted: Mon Aug 06, 2012 11:57 am
by steveps3
I am still getting scaling issues.

My duplicated object has a scale of 1x1x1
My particles system has the object size as 1 with zero randomness
When I export the particle system I have to scale the duplicated object at least 20 times in order to get it back to the size it was inside of Blender.

Looking at the matrices, the scaling looks quite small (is it right that the file is not a CSV?)

-0.000622 -0.036512 0.016325 -2.50315 -0.039994 0.000681 -0 -2.97594 -0.000278 -0.016322 -0.036517 -1.12284
0.003593 0.002179 0.039779 0.362398 -0.020737 0.034205 0 -2.10696 -0.034016 -0.020622 0.004202 -3.43214
0.029992 0.025276 -0.007848 3.02667 -0.025777 0.030587 0 -2.61555 0.006001 0.005057 0.039223 0.607507
0.024423 0.026323 -0.017624 2.46328 -0.029323 0.027206 0 -2.97613 0.011987 0.012919 0.035908 1.20822

Script version 1.18 FYI

Re: Blender instances "patch" for the unofficial exporter

Posted: Mon Aug 06, 2012 3:49 pm
by matej
@Steve, have you touched any other PS settings that affect their scale? (there is a whole lot of them)

Without an example .blend that reproduces this, I cant really help.

Re: Blender instances "patch" for the unofficial exporter

Posted: Tue Aug 07, 2012 8:13 am
by steveps3
Ahh, found it. For some reason you are using the particle normal velocity to scale the particles. So in my example I set the normal to be very small because I wanted the particles to touch the object from which they were being projected. This has the effect of scaling the particles wayyyyyy down. When I set the normal to 1 then they appear the right size. Guess what, set the normal to 2 and the particles become twice the size.

Why should the normal velocity affect the particle size?

I am far from an expert but I think it is down to the scaling of the particles by the hair length. Some sort of check to see whether the PS is hair is required. If it is an emitter then no scaling should be performed.

rot = Quaternion.to_matrix(p.rotation).to_4x4()
scale = Matrix.Scale(p.size, 4) * Matrix.Scale(pset.hair_length, 4)
t = loc * rot * scale
t = emitter.matrix_world * t

Re: Blender instances "patch" for the unofficial exporter

Posted: Tue Aug 07, 2012 10:51 am
by matej
steveps3 wrote: Why should the normal velocity affect the particle size?
In case of hair PS anything in the velocity tab also affects scale. Normal is the only param. supported currently. The scaling by hair length correction must be there to get the correct object scale for hair length. But in case of emitter PS the params. in the velocity tab affects position not scale.
steveps3 wrote:I am far from an expert but I think it is down to the scaling of the particles by the hair length. Some sort of check to see whether the PS is hair is required. If it is an emitter then no scaling should be performed.
Yes. Tough, it's not enough to just remove the scaling by hair length term, position must be also adjusted. If you are not interested in posiiton, for now you can replace that line with:

Code: Select all

scale = Matrix.Scale(p.size, 4) * Matrix.Scale(pset.hair_length, 4) if pset.type == "HAIR" else Matrix.Scale(p.size, 4)
Thanks for the report, I'll see to it in the next update (not very soon, sorry, as I'm a bit busy with other things right now).

Re: Blender instances "patch" for the unofficial exporter

Posted: Tue Aug 07, 2012 12:06 pm
by steveps3
Well I am starting to get some results. Blender seems to be really struggling with all the particle systems. I currently have 6 of them with a total of around 55,000 particles.

There are some odd grassless patches that I need to look into but so far so good.

The pink things will be buildings by the way.

Re: Blender instances "patch" for the unofficial exporter

Posted: Sun Sep 09, 2012 9:57 am
by steveps3
I've just spotted a bug in the exporter script. It only exports the percentage of the particles that you have set to be visible. I currently have about 200,000 particles in my model and I've just reduced the visible down to 1% just so that I can see where they are but maintain a responsive system. Now when I export I only get the 1% of the particles exported. This means that I have to up the percentage to 100% just to export the particles and then reduce the figure again.

Any chance of a tweak to the script??

Re: Blender instances "patch" for the unofficial exporter

Posted: Mon Sep 10, 2012 1:09 pm
by ROUBAL
It is the principle of the script to export only visible things, so I think that it is up to you to set up the number of visible particles at 100%.

Re: Blender instances "patch" for the unofficial exporter

Posted: Mon Sep 10, 2012 7:09 pm
by steveps3
Really? What is the point of that. If I make all of the particles systems visible then blender is on the verge of crashing. It sems much more sensible for it to export all of the particles that are alive. They are only invisible in view mode. If I were to use the internal renderer then they would get rendered so why shouldn't they get exported?