• Login
sketchucation logo sketchucation
  • Login
πŸ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Face Me Scaling bug?

Scheduled Pinned Locked Moved Developers' Forum
11 Posts 5 Posters 325 Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    Chris Fullmer
    last edited by 11 Dec 2009, 10:13

    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

    Lately you've been tan, suspicious for the winter.
    All my Plugins I've written

    1 Reply Last reply Reply Quote 0
    • M Offline
      MartinRinehart
      last edited by 11 Dec 2009, 17:03

      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
      
      

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 11 Dec 2009, 18:09

        you even need to make a class? what about GT = Geom::Transformation ?

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 13 Dec 2009, 23:21

          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

          1 Reply Last reply Reply Quote 0
          • C Offline
            Chris Fullmer
            last edited by 14 Dec 2009, 00:44

            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

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • M Offline
              maxim1000
              last edited by 22 Feb 2010, 11:13

              @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,
              Chris

              Has 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.

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 22 Feb 2010, 11:21

                Instead of
                t = Geom::Transformation.scaling(2.0)
                use this variant:
                t = Geom::Transformation.scaling(2.0, 2.0, 2.0)

                Think that works.

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • M Offline
                  maxim1000
                  last edited by 22 Feb 2010, 12:44

                  @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?

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 22 Feb 2010, 12:51

                    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.

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      Chris Fullmer
                      last edited by 22 Feb 2010, 18:04

                      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 πŸ‘Ώ

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 22 Feb 2010, 18:07

                        @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!

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement