MassFX gravity / units issue.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2013   #1
MassFX gravity / units issue.

I'm using MassFX in 3DS Max 2014 to just roll a ball down a slope, and I set it up, and I get it working just right. So far, so good.

Then upon reloading the scene, it completely messes up all of the scale based settings, namely acceleration, and the contact distance / rest depth, and also the radius of the sphere collider on the object. Now things just explode apart, because the numbers are off by orders of magnitude.
But it is not random, in fact it is scaling by 25.4/2.54, converting to imperial measurements / inches. My scene is set up in metric, and it seems to not want to abide!

For now my workaround is to set my units to inches, but this is not an ideal solution, because now I can't see proper units for anything, just generic units, and at the scale of the scene, the large numbers are not very practical, especially when working with a physics engine that relies on real world values. Also, I'm worried about other calculations now being incorrect due to the entire scene being the wrong scale according to 3DS Max (although I could change it back once I'm done with the physics, but I don't want to be locked into that).

Is there something I'm overlooking or doing wrong to make MassFX correctly save the values while using metric units, or is it somehow possible that MassFX can't handle the measurement system of every single country in the world, with the exception of 3?
 
Old 11 November 2013   #2
Hmm, this doesn`t happen here. What is saved as metric, stays metric after loading the scene again.
Maybe try the usual things like deleting 3dsmax settings file:
C:\Documents and Settings\<username>\Local Settings\Application Data\Autodesk\3dsMax\<version>
and start again.
And make sure you have all the service pack and that you installed 3dsmax with administrator rights.
__________________
Meli
 
Old 11 November 2013   #3
Happens here, too, but values seem to grow by a value of 100 each time a file is saved and loaded. At least with metric units.
Tried some combinations of different system and display-units and so far it happens all the time.
Interestingly enough an acceleration of -10 inches ( with system units set to inches ) becomes
-393,701 inches. (*100 and then apparently converted to inches again. Or some other strange conversion with those imperial units. )

@MGernot: Did you check the global gravity? An acceleration of -9,81 might become -981 and look ok at first glance.
Service packs are installed and I'm pretty sure I installed with admin rights. (Not 100% , though.)

Last edited by Noren : 11 November 2013 at 01:10 AM.
 
Old 11 November 2013   #4
Gladly i stored my lengthy post i originally intented to write in response to this thread, until i realized that the OP was talking about PFLow

Back to the MassFX scale issues after reload:

You propably are hit by a serious design flaw of current (Max 2013/2014) MassFX versions, that exists when dealing with legacy MassFX scenes ( created in Max 201/2011/2012 ). Maybe your problem is caused by something else, but nevertheless, here's some lengthy post, describing the flaw i'm talking about. For the solution of the problem simply browse down to the last part of the post ( "Solution" )

This is a problem when loading MassFX scenes into Max 2013/2014 which were originally created in earlier PhysX/MassFX versions ( Max 2010/2011/2012 ). In those earlier days, MassFX/PhysX stored the physics world scale and other essential settings, in the external file properties. You can easily verify this by using Explorer->Properties->Custom, just see screenshot attached. This is all fine when the files are actually loaded by those legacy Max/PhysX versions, but it totally breaks the scene when loaded, changed and resaved with current Max versions (2013/2014).

Current MassFX versions store those PhysX/MassFX related settings in the Max scene file itself, which is the far better solution. What happens now though, is that current Max/PhysX versions (the loading scripts to be exact), trigger a "legacy compatibility" mode as soon those external file properties are detected and the external, legacy properties are read in and applied to the PhysX world.

Imagine you make changes now to those MassFX/PhysX related setting in your current Max Version, like let's say you change the Max world units, and save the Max file. The problem is that those legacy file properties DO NOT GET UPDATED and are NOT REMOVED from the file. They still sit UNMODIFIED, UNUPDATED on your Max file without you noticing.
Because of that, the legacy compatibility code in the script triggers again next time this Max scene gets loaded into Max ( because those old, outdated file properties are still on the file) and get PRIORITY over your recently modified and saved internal Max scenefile MassFX/PhysX settings...

And BAM !:
your carefully tweaked and balanced Max/MassFX scene gets loaded and totally wrong and outdated PhysX/MassFX settings get applied all over the place ( PhysX units<->Max units do not match etc..). Just because MassFX does'nt read your updated internal values, but gives priority to the outdated external file properties..



*** SOLUTION ****

* Be sure to CLEAN ALL external file properties starting with "px_* when bringing in legacy scenes to current PhysX/MassFX versions ( or Max versions ). Essentially every Max scene showing those file properties is affected by the flaw, so remove them on scenes not intended to work with Max 2010/2011/2012. See attached screenshot for a reference how those file properties look. The problem is, that all your physx related force, mass and dimension and distance settings (eg. RB scale) and global physx world settings are probably totally off already. There is no way arround as to fix them manually, after you removed the file properties of course...

* Most important:
CHECK YOUR "MAXSTART.MAX" FILE !!! If this file already is "infected" by those legacy file properties ( because you saved it with a legacy Max version or simply copied it over from your legacy Max installs),
ALL YOUR FUTURE PHYSX SCENES WILL FAIL AND BREAK ON RELOAD WHEN YOU CHANGE GLOBAL MASSFX/PHYX SETTINGS.
The latter happened to me, and that's the cause i investigated and found that flaw. My RB gizmos/collision meshes etc ALWAYS got f*cked up totally scale wise after scene reloads because of the file properties on my "maxstart.max". Maybe this is exactly the problem here...

I reported this bug/design flaw already, but am not quite sure wether it reached the right people. So please report thoset thing too. It'S a really serious matter. Ironically you get hit by it most prominently, as soon as you change your Max system units from meter to anything else, as MassFX defaults to meters, so after you change that you might immediatly see the off scaled RB geometries etc. after a reload ....
Attached Images
File Type: png px_properties.png (18.3 KB, 22 views)
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio

Last edited by spacefrog : 11 November 2013 at 07:28 AM.
 
Old 11 November 2013   #5
Thanks for the reply spacefrog! I checked, and the file doesn't have any of that in the custom properties. It's a new file started in Max 2014, and I've only used MassFX once in the past on a scene that I haven't opened since in more recent versions. And I don't have a maxstart.max file, so I can't check that.
Could just having a previous version of max still installed cause any issues?

Originally Posted by MGernot: Hmm, this doesn`t happen here. What is saved as metric, stays metric after loading the scene again.
Maybe try the usual things like deleting 3dsmax settings file:
C:\Documents and Settings\<username>\Local Settings\Application Data\Autodesk\3dsMax\<version>
and start again.
And make sure you have all the service pack and that you installed 3dsmax with administrator rights.


I have all of the service packs installed. I'm not sure if I installed 3DS Max with admin rights, but unless that's the default, then very possibly not, so I can try that, and deleting the settings.
 
Old 11 November 2013   #6
Thx a lot spacefrog, seems awfully similar, but it's the same here as BlobVanDam wrote already.
This loading script sounds like a very probable culprit, though.

FWIW, I installed 3ds Max 2010 after 2014.
 
Old 11 November 2013   #7
Originally Posted by Noren: Thx a lot spacefrog, seems awfully similar, but it's the same here as BlobVanDam wrote already.
This loading script sounds like a very probable culprit, though.

FWIW, I installed 3ds Max 2010 after 2014.


Yes - but there is a solution to the problem:
strip those file properties as soon as you open a scene from Max 2010/2011/2012 in Max 2013 or higher. After you did that there is no problem with scale any longer. At least not such a obvious flaw as insanely rescaled RB collision objects after a reload.
MassFX adopts to the Max's unit setting quite well when those file properties where removed, so you can use any unit setting you want, as long as your dimension/mass/force values match and are consistent with the scene scale
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
Old 11 November 2013   #8
Unfortunately not. I can see the properties in files created by those old versions, but the file in question (created in Max2014) has none.
 
Old 11 November 2013   #9
Originally Posted by Noren: Unfortunately not. I can see the properties in files created by those old versions, but the file in question (created in Max2014) has none.


just checked myself and indeed it's true: i too still got scale issues...
But only when i change the system units to a different unit system than the one i had during Max startup ( due to my maxstart.max). As long as i stay in the same unit system Max started up with, the scale issue does not occur). So loading a scene which requires a different unit system than your initial maxstart.max unit system would introduce the scale issue... I bet there is some unity change callback hook missing or not triggering correctly ...

I'll investigate further as this wrong scaling is definitely happening during the scene load callback scripts and should be fixable. Strange thing is though that i tested this thoroughly about 1-2 month ago and the scale issue was not there as soon as the file properties where stripped ... Maybe i was still on SP2 then
Which SP do you guys use ?

EDIT: i checked back and found out that i tested and reported this issue over 3 month back already, so i'm sure i was only on SP2 back than...
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio

Last edited by spacefrog : 11 November 2013 at 04:08 PM.
 
Old 11 November 2013   #10
I'm on SP3.
 
Old 11 November 2013   #11
I'm also on SP3. Never tried this in earlier versions, so I can't say if the issue existed or not in them on my end.
 
Old 11 November 2013   #12
I found out that SP does'nt matter at all. It looks like those MassFX scripts where'nt touched since 2012, long before 2014 release

I have some suspicion about all this mess, and it might have to do with using a "maxstart.max"
which would trigger correct Max<>MassFX unit settings due to some file load callbacks

Most propably what's happening in your scenes is that PhysX Unit system does'nt match the Max system units because of missing callback hooks without "maxstart.max"

EDIT:
The person who wrote the scripts ( i guess an Nvidia person) definitely did'nt get the whole story about Max's unit system ( and the display units vs. system units story).
Just look at this comment in one ofthe scripts
Quote: -- Max Unit and Physics
-- It seems Max values are in unit of centimeter no matter what it displays. And SPEC asks to display all PhysX values in unit of meter.
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio

Last edited by spacefrog : 11 November 2013 at 04:29 PM.
 
Old 11 November 2013   #13
Okay :

You can easily check the culprit by comparing those two variables in the listener

Quote: px_plugin_unittype

reports the physx internal unittype, which is stored in the physxpanel rollout too ( physXpaneldata.unitType )
In contrast the following gives you the unit code for Max's system unit setting
Quote: PxUnitTypeToEnum(units.SystemType)


If those numbers are different, your MassFX/PhysX world is f*cked up, this happens somewhen during the file load...
Next step is to find the faulty script sections and come up with something to fix this mess ...
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
Old 11 November 2013   #14
I think for the time being, the best method to ensure consistency between MassFX units and Max system units is :

NEVER EVER change system units in a Max session and start to use MassFX in the same session. Changing system units WILL SPOIL ALL MASSFX SETTINGS created (afterwards) in the same session.

If you have to change your Max's system units, follow the exact steps below

In case you do not use a "maxstart.max":
Change system units, quit and restart 3ds Max and start creating your MassFX scene in this new 3ds Max session

In case you use a "maxstart.max":
Create a specific "maxstart.max" which has the desired system units stored. This has the benefit that "File->Reset" will serve the same purpose as the "restart Max session" step above.
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
Old 11 November 2013   #15
God what a nightmare. Glad we haven't upgraded from max 2012 yet at work. :(

First the issue of PhysX plugins making Max files incompatible with unmodified versions and now this.

Thanks for spotting it spacefrog, even if it's not fixed yet.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:20 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.