[Closed] next strange thing: worldunits
Hi community,
I am standing in front of my next strange problem which drives me crazy.
I made a script while having “System Unit Scale” set to “0.01 Meters” and my script
works very well. I now tried to set 3dsMax to another Unit System Scale and it doesn’t work anymore!
What the script does ist basically put particles on an object. A spinner in my frontend
(set to type:#worldunits) controls the particle size. My variable is set to 3.0 in the code, which results in 0.03m with my System Unit Scale in the frontend. Testobject is a 0.3m teapot.
If the System Unit Scale is set to “1.0 Meters” (and the teapot is resized 0.3m afterwards) and the spinner value is set to 0.03m again, the script ends with no particles…
What’s the problem?! :o/
Let’s try to summarize:
*System Units: 1GU = 0.01 Meters.
*Test Object Size in GU: 30.0
*Test Object Size in User Units: 0.3m
*A variable in your code with value of 3.0 means thus 0.03 meters.
*System Units: 1GU = 1.0 Meters.
*Test Object Size in GU: 0.3
*Test Object Size in User Units: 0.3m
*Spinner is set to 0.03m which results in a value of 0.03 in generic units.
So far, so good.
What is not clear from your description – does the spinner in the second case control the value of the variable mentioned in the first case? If yes, I would expect the variable to end up as 0.03 generic units and still work correctly.
Please try to express your setup in shot bullet lists (Deutsch: Stichpunktartig! ) to make it easier to understand what is going on in your code. The closer your explanation to pseudo-code, the better.
Does nobody have an answer? I think this is very strange and I never had such a problem…
Changed System Units and matched object parameters: wouldn’t that be exactly the same in the end? Wouldn’t 0.03m in “0.01 Meter System Units” be the same then 0.03m in “1 Inch System Units”? Or is particleFlow again doing something wrong? Or is it me thinking wrong? :shrug:
Hey master bobo!
Your bullet list (thanks for translating that) is cool, thanks!
The spinner controls the variable, yes. All my spinners control variables used in the script. If there were no problems if I directly use the values of the spinners for my calculations that would be great! I should try that before…
The script does…
[ul]
[li]generate particles (pFlow) on object surface (particle count based on face area of selected faces)[/li][li]spinner controls the particle size (a value of 0.03m [3.0 in my code, System Units: 1GU = 0.01 Meters] worked out to be the best choice for that)[/li][li]some blobMesh things going on afterwards (I read those size values are taken from the particles)[/li][/ul]That’s all…
Ok… if I understand that bullet list it would fix my problem to set my variable in my script to 0.03 (GU), resize my teapot to have 0.3m radius again and everything should work fine… right? But it doesn’t work! What am I doing wrong?
For those following this thread, the problem had nothing to do with MAXScript, but everything to do with Units.
Turns out the PFlow was used to generate a BlobMesh, and the BlobMesh has a limitation to the system units scale it can operate on. At 1GU = 1m, a Teapot with 0.3m radius was in fact 0.3 units large, and the particles on it had distances much less than that. The minimum sized BlobMesh I could get at that scale was at least 3 times bigger than the Teapot and I couldn’t get it smaller, which means that there is something hardcoded inside of it that prevents it from creating structures smaller than a certain value.
Once again, if you are using System Units where 1 GU is 1m, your scene better not try to display any detail that is below 1m. (City planning is a good place to use such scale). Due to the Single Precision of Floats in 3ds Max, trying to do work below 1GU will always be dangerous and could have unpredictable side effects.
Thank you very much!
The answer to my question is:
A BlobMesh with particle size smaller 1 Generic Unit is not a great idea. BlobMesh is “too old” for some perposes.
One should use 1GU = 1m only for urban planning or things like that, when there are not many details smaller than one meter.
Thanks for that answer,
Fabian
edit: we posted nearly the same time… ups! I also wanted to inform all readers.