Face Me Scaling bug?
-
I am not succesfully getting face me components to scale. Select a face me component, then run this line of code (yes, its a single line):
Sketchup.active_model.selection[0].transform!( Geom;;Transformation.scaling(2.0))
It makes them jump around. Are other people succesfully scaling face me components? Should I do it using the transform matrix instead? Any thoughts at all on this?
Chris
-
Sketchup.active_model.selection[0].transform!( Geom;;Transformation.scaling(2.0))
I don't know the answer to your question, Chris. An observation, tho: You'll get a lot more mileage from your fingertips if you create some cheater classes:
class GT < Geom;;Transformation end
-
you even need to make a class? what about
GT = Geom::Transformation
? -
Lateral thinking fix ?
Test if the instance's defn has its 'face_me' behavior set as 'true',
if so then remember that it was and then set the defn's 'face_me' behavior to 'false',
scale the instance,
if you have remembered the defn's 'face_me' property was 'true' before the scaling then reset it back to 'true' now.
???
-
TIG!!! That might be it! I'll try to commit that to code shortly. I really like the idea, lets hope it works as nicely as it sounds,
Chris
-
@chris fullmer said:
TIG!!! That might be it! I'll try to commit that to code shortly. I really like the idea, lets hope it works as nicely as it sounds,
ChrisHas anybody positive results with this technique?
I've tried to make always_face_camera false, scale and then return back always_face_camera to true, but on the last step, model becomes shifted and has "jumping" behavior. -
Instead of
t = Geom::Transformation.scaling(2.0)
use this variant:
t = Geom::Transformation.scaling(2.0, 2.0, 2.0)
Think that works.
-
@thomthom said:
Instead of
t = Geom::Transformation.scaling(2.0)
use this variant:
t = Geom::Transformation.scaling(2.0, 2.0, 2.0)
Think that works.
Wow... Thanks.
Just curious: how did you find out this? -
I didn't. Think Chris came across it trying to work it out.
t = Geom::Transformation.scaling(2.0)
modifies the 16th value in the transformation matric that makes lots of things go wrong.t = Geom::Transformation.scaling(2.0, 2.0, 2.0)
ensures a proper transformation.Go figure.
-
Exactly. If you use the built in uniform scaling method, then SU cheats and just adjusts the 16 element of the matrix, which acts as a multiplier over the rest of the matrix. Previous versions of SketchUp recognized this odd behavior and worked with it. But 7.1, when they re-wrote the SU rendering engine, they did not acccount for this cheap scaling shortcut, so it does not display face-me components whose 16th value is anything other than 1 very well - hence the jumping and spinning.
BUT, if you instead use the scaling method that lets you modify each axis separately (like Thom showed with 3 parameters), and set them to all be the same - it acts just like a uniform scale, AND SU takes the time to write all the scale factors correctly into the matrix where they should be, and it leaves the 16 element at 1.
AND 3rd aprty renderers do not appreciate the 16th element of the matrix being anything other than 1 also. So they often freak out when they come across these face-me's that have been incorrectly scaled.
Yeah, this was a fun bug to track down
-
@chris fullmer said:
AND 3rd aprty renderers do not appreciate the 16th element of the matrix being anything other than 1 also. So they often freak out when they come across these face-me's that have been incorrectly scaled.
Previous version of VfSU didn't like that type of transformation.
The new one seem to deal with it properly.@chris fullmer said:
Yeah, this was a fun bug to track down
Obcurity - thy name is SketchUp!
Advertisement