sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Unexpected behaviour with Rotate and Material combination.

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    6 Posts 4 Posters 1.3k Views 4 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.
    • Alan FraserA Offline
      Alan Fraser
      last edited by

      Some of this is probably covered in other threads, but I thought it might be useful to show a specific example.

      This is a very simplified version of a vehicle barrier that I recently modelled for FormFonts. The FF version also has the option to change the length of the arm from a drop-down list...and I'm also working on a version with an attached traffic light that switches from red to green as the barrier goes up.

      This simplified version has only two functions...the barrier arm will rise and fall if you give it the finger...and you can change the colour of the base unit from a selection.

      The thing is that both of these attributes...the rotation and the material change...will work on the "bad" model just fine...as long as you only activate one of them, not both.
      You can make the arm go up and down to your heart's content, OR you can cycle through the material options without a problem. What you can't do is move the arm AND change the material.

      The unexpected result is all the more surprising because it is a change of scale and proportion...which is not an obvious result of changing either the material or rotating the arm.

      The reason for it is that in rotating the arm, you change the overall proportions of the component as a whole...so when it redraws after a material change you get it horribly squashed or stretched. You would get exactly the same thing with the same choice of options on a door, because the barrier is basically just a door lying on its back.

      The solution is to set the position (XYZ) and Size (LenX,LenY,Lenz) of both the base unit (door frame) and barrier (door) in stone by double-clicking them and putting an = sign in front. That, in effect, freezes them so that they can't distort. This is what I've done in the orange (good) example.


      barriers.skp


      barriers_thumb.jpg

      3D Figures
      Were you required to walk 500 miles? Were you advised to walk 500 more?
      You could be entitled to compensation. Call the Pro Claimers now!

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        @alan fraser said:

        if you give it the finger...

        I like that Alana. In my mind I keep saying "when you finger the object" πŸ˜†

        Its an interesting post Alan. I'll download the components when I get back to an SU7 computer and check it out. I have a feeling this is one of those things I'll forget about, then in 3 months it will come up in a model I'm working and I'll have no idea how to fix it. So if you wouldn't mind just sending me the url to this post in precisely three months from today, I'm sure that future me will need that information direly! πŸ˜„

        Chris

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

        1 Reply Last reply Reply Quote 0
        • R Offline
          remus
          last edited by

          Thats really weird, certainly worthy of a bug report if this thread doesnt count as such.

          http://remusrendering.wordpress.com/

          1 Reply Last reply Reply Quote 0
          • Alan FraserA Offline
            Alan Fraser
            last edited by

            It's not really a bug. Google got around it the same way with the wooden coffee table. It's more a Microsoft-ism.....entirely logical but extremely unhelpful.
            Maybe Scott or someone will eventually figure out a way of building the error handling into the system, rather than having to actually write it out each time in the attributes.

            3D Figures
            Were you required to walk 500 miles? Were you advised to walk 500 more?
            You could be entitled to compensation. Call the Pro Claimers now!

            1 Reply Last reply Reply Quote 0
            • scottliningerS Offline
              scottlininger
              last edited by

              Alan,

              That's a bug. I've filed it and am poking around to see how your model got into this state.

              The workaround is to add a formula at the top level that keeps the LENX, LENY, and LENZ attributes fixed. See the attached model for the fix. All I did was add a formula into each of those attributes, and now it works.

              NOTE: If you see this sort of thing happen again, it is because SketchUp has forgotten the correct size of the component after it's animated. A hacky trick to force a "refresh" of the component size is to double click down into edit mode of each of your subcomponents. The act of entering component edit mode forces a refresh of the cached component size.

              Cheers,


              barriers_constrained.skp

              • Scott Lininger
                SketchUp Software Engineer
                Have you visited the Ruby API Docs?
              1 Reply Last reply Reply Quote 0
              • Alan FraserA Offline
                Alan Fraser
                last edited by

                Thanks Scott. That's pretty much what I did with the orange one, which works just fine. They grey one, on the other hand gets squashed flat if you force a redraw after animating. the barrier

                3D Figures
                Were you required to walk 500 miles? Were you advised to walk 500 more?
                You could be entitled to compensation. Call the Pro Claimers now!

                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