Urgent - Is there a script to reset/zero all transformation?
-
ok thanks TIG! I couldn't remember if it was more than just those 3 classes. In the end, I just filtered out anything that was not a group or componentinstance. I think that works out safely.
And the theory behind what my code is fixing is simple. SU uses a cheap trick to sometimes adjust the global scale of objects. It just changes the 16 element of the transformation matrix from "1.0" to a global multiplier (0.5 if the component is scale 2x larger, for example). And then it multiplies the rest of the transformation object by that 16th element. BUT, the 16th element of the transformation array is ignored by most other apps. So when exporting to renderers, they often do not take into account that a component might have a global scale modifier applied to it, hiding in that 16th element. Thus they ignore the global scale entirely, causing problems.
So this snippet will go through and determine what the global multiplier is, and apply it to the transformation matrix and reset the 16th element to 1.0. Thus the components should export correctly because all their scale data should be contained in the regular location inside the transformation matrix.
We'll see if it really helps though.
Chris
PS. This snippet WILL fix face me components that rotate all crazy in SU 7.1, as that is also a side effect of SU's own cheap global scaling trick, if anyone is having problems with that.
-
Did you get a chance to test this Jan?
-
@chris fullmer said:
Did you get a chance to test this Jan?
Sorry for not getting back.
I managed to export the scene in smaller chunks and am currently finishing it up in time for my deadline.
I will try it when things calm down later this week.
Thank you very much, I'm sure I will use this in the future. -
@unknownuser said:
The best way to tackle this issue is to explode EVERYTHING. It takes a while, especially with larger models, but it's nearly full-proof. Same thing happens when exporting to certain other formats. The Group/Comps structure of SketchUp isn't translated properly. Exploding the model puts everything in one context.
You might want to have a look a TBD's Bomb script. It explodes everything without having to do it manually. It takes the same amount of time, but you can 'set-it-and-forget-it' and wait till it's done. Might be hours though.
HTH
The thing is I don't want to explode everything, since that removes any control over how lightmapping is applied on certain objects.
Anyway you can watch the result here:
http://forums.sketchucation.com/viewtopic.php?f=81&t=28907 -
Please oh pretty please try my code snippet? Just to see if it helps, or if it even just doesn't crash. I'd love to see if that little bit of code could fix it all.
Chris
-
Oh and maybe I didn't explain it well enough. It does not change anything visually in the model. It will all look exactly the same. Nothing gets exploded. So just run it, then re-export and see if it helps sort out the issues. Thanks!
Chris
-
@chris fullmer said:
Please oh pretty please try my code snippet? Just to see if it helps, or if it even just doesn't crash. I'd love to see if that little bit of code could fix it all.
Chris
I will I will. Next week I'll have to make some modifications so I'll have to re export at least parts of the scen. I will try it then if not before.
-
Chris, I tried the script but it didnt work. Same mess as before.
Will try again later. -
Bummer, I was very hopeful. Any chance you could forward me a copy of your model to test a few things on?
-
I'll do that tomorrow.
Advertisement