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

    [Plugin] Descaler v1.1 20121218

    Scheduled Pinned Locked Moved Plugins
    31 Posts 16 Posters 24.9k Views 16 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.
    • M Offline
      matt.gordon320
      last edited by

      @tig said:

      there are other tricks to scale textures back to be 'right' within scaled DCs code/functions...

      Hi TIG, would you by chance be willing to elaborate on descaling functions you alluded to relative to DC's? That's pretty much the only thing holding me back from getting clearance to build my firm a DC library.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        This is a well known issue: http://sketchucation.com/forums/viewtopic.php?f=289%26amp;t=44979

        Textures in DCs behave as Textures in any other SketchUp Component: if you Scale the Object you Scale its Texture.

        BUT there is a DC "trick" that will avoid this.

        If your DC contains at least one sub-component/group that is also a DC and that positions itself with a formula [even if the move=0], then when you use the Scale tool on the parent DC any "raw geometry" inside that parent DC will be "resized" instead of just "stretched" - so there is no "scaling" of the texture.

        The context-menu "Scale-Definition" used on a unique DC will also reset the Texture's scale back as it was, BUT then that will loose the DC scaling ?


        DC-ScalingKeepingTextureSize.PNG

        TIG

        1 Reply Last reply Reply Quote 0
        • M Offline
          matt.gordon320
          last edited by

          @tig said:

          If your DC contains at least one sub-component/group that is also a DC and that positions itself with a formula [even if the move=0], then when you use the Scale tool on the parent DC any "raw geometry" inside that parent DC will be "resized" instead of just "stretched" - so there is no "scaling" of the texture.

          TIG, that's just brilliant! I have one more that came to mind in that case.

          I'm creating a series of DCs that cut into a single plane wall, with adjustable recess and window parameters (width, height, mullions,etc). For this "trick" you mentioned to apply, do any materials need to be embedded as options or swatches within the DC, or can it inherit materials by painting a DC instance (where the "default" painted faces would inherit the new material).

          I'd like to be able to sample the wall texture and paint the component, so that the recess will inherit the correct texture from the wall material.

          Recess Texture DC Brick.png

          I know there's a good chance the UV orientation might not be perfect, but it'd be nice to have it work that way. Can't always get everything perfect. I'm currently building on as a test, but I'm still fairly new to DCs as a whole, so it might take me quite a few tries to test it out and uncover the answer solo.

          Thanks for all the help so far!

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            If you have a series of materials you do need to embed small swatches inside the DC, so purging won't remove them.
            Then you can specify the material by 'name' in the DC Material= function.
            BUT you can only apply materials to groups/instances inside the DC.

            There are several advice pages on the swatch workaround...
            I posted my fix because it's less well documented and fixes materials on faces inside scaled DCs, rather that applies different materials to objects in the DC...

            My method assumes the loose faces inside the DC have materials... and the ScalerDC 'change' jolts the contents into recreation, with corrected scaling.

            TIG

            1 Reply Last reply Reply Quote 0
            • M Offline
              matt.gordon320
              last edited by

              @tig said:

              ... and the ScalerDC 'change' jolts the contents into recreation, with corrected scaling.

              Thanks TIG, I appreciate the help. I think I'm going to have to do some thorough testing to get first hand experience with it.

              Dependent on the axis orientation (say a window that utilizes glue to), does the ScalerDC have to be in the X axis or will others work? Just trying to get a better and more thorough understanding of exactly what it's doing.

              1 Reply Last reply Reply Quote 0
              • U Offline
                unearthed
                last edited by

                Hi TIG, When I ran Descaler it successfully descaled all components but gave all my components unique names. Components are all either circles or simple 2D blob shapes, lying flat. Is this a bug? Or is there a way 'round it?

                Growplan - People ∩ Plants ∩ Place

                windows 7 64b, 4GB RAM, SU 8.0.16846
                Gimp, QGIS, Vectorworks 12, Bricscad 11

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  @matt.gordon320 said:

                  @tig said:

                  ... and the ScalerDC 'change' jolts the contents into recreation, with corrected scaling.

                  Thanks TIG, I appreciate the help. I think I'm going to have to do some thorough testing to get first hand experience with it.

                  Dependent on the axis orientation (say a window that utilizes glue to), does the ScalerDC have to be in the X axis or will others work? Just trying to get a better and more thorough understanding of exactly what it's doing.
                  ANY change in the 'position' of ScalerDC jolts textured faces into being 'rescaled' back to normal if the 'parent' DC is Scaled.
                  If you look at its formula: X =parent!X-parent!X - it effectively sets X=0 which is where it is initially placed: any change to its X, Y or Z should have the same effect.
                  I not sure 'why' it works... but it does 😲

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • TIGT Offline
                    TIG Moderator
                    last edited by

                    @unearthed said:

                    Hi TIG, When I ran Descaler it successfully descaled all components but gave all my components unique names. Components are all either circles or simple 2D blob shapes, lying flat. Is this a bug? Or is there a way 'round it?
                    It always makes the 'descaled' instance unique.
                    BUT you can edit the script TIG-Descaler.rb using a plain text editor like Notepad.
                    If the lines starting at line#71

                    if c.is_a?(Sketchup;;Group)
                      defn=c.entities.parent
                      c.make_unique if defn.instances[1]
                      defn=c.entities.parent
                    else ### it's a ComponentInstance
                      defn=c.definition
                      c.make_unique if defn.instances[1]
                      defn=c.definition
                    end
                    

                    Change it to read thus:

                    if c.is_a?(Sketchup;;Group)
                      defn=c.entities.parent
                      #c.make_unique if defn.instances[1]
                      #defn=c.entities.parent
                    else ### it's a ComponentInstance
                      defn=c.definition
                      #c.make_unique if defn.instances[1]
                      #defn=c.definition
                    end
                    

                    That way the lines starting with # are ignored and the objects are not made unique ! πŸ€“
                    BUT note that if you have several instances with different scaling then the end results might be unexpected... πŸ˜’

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • U Offline
                      unearthed
                      last edited by

                      Thanks very much TIG - I'll go off and test it on some components with diff. scaling and see what comes up.

                      These are for plants as my numbers are climbing into the 1000's (and soon into the 10,000s) so I export to Excel/Vectorworks for counting etc.

                      Growplan - People ∩ Plants ∩ Place

                      windows 7 64b, 4GB RAM, SU 8.0.16846
                      Gimp, QGIS, Vectorworks 12, Bricscad 11

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        Penelope
                        last edited by

                        Hi TIG
                        I'm running SketchUp Pro 2015 (Version 15.3.331 64-bit). I installed this plugin and tried right-clicking on one of the scaled Dynamic Components I have with messed-up textures. But I don't see your plugin.
                        Might it be buried somewhere else not obvious?
                        Has something changed recently with Sketchup which keeps it from working?
                        Thanks.
                        Penelope

                        1 Reply Last reply Reply Quote 0
                        • TIGT Offline
                          TIG Moderator
                          last edited by

                          @penelope said:

                          Hi TIG
                          I'm running SketchUp Pro 2015 (Version 15.3.331 64-bit). I installed this plugin and tried right-clicking on one of the scaled Dynamic Components I have with messed-up textures. But I don't see your plugin.
                          Might it be buried somewhere else not obvious?
                          Has something changed recently with Sketchup which keeps it from working?
                          Thanks.
                          Penelope
                          If you read through the thread... unfortunately it does NOT process Dynamic Components.
                          Any subsequent change to the DC would immediately mess up the [re]textured material.
                          You can try exploding the DC, and then regrouping/re-component-ing - without DC attributes...
                          Then it will work...

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • 3dita3 Offline
                            3dita
                            last edited by

                            I'm only finding about this plugin now. So it's basically a reset xform for Sketchup?

                            3dita - Digital Visual Motion

                            1 Reply Last reply Reply Quote 0
                            • B Offline
                              bsfranza
                              last edited by

                              hi there,

                              im currently struggeling with 3d warehouse models.. some of them scaled wrong and consist of groups components, scaling them down is no problem to have the right size, but to avoid rendering issues wirth third party apps etc i want all groups and components to be 1:1 and not scaled.. so i come to use your plugin which processes nested entities, however, there are 2 problems...

                              first: if the mothercontainer is not scaled, but its children, the plugin does not show in the context menue πŸ˜„ ...

                              second: in contrary to fredos "scale definition" descaler kind of breaks uv mapping:) .. (most likely due to processing entities like faces and lines too?)...

                              would be cool if these issues could be adressed in a future release πŸ˜„

                              best, franz

                              1 Reply Last reply Reply Quote 0
                              • P Offline
                                pibuz
                                last edited by

                                hi TIG and hi to all the readers!
                                I'm finding very useful the TIG's trick for keeping the scale of the texture!
                                I'm now struggling with same topic on a curved surface, but seems like the trick doesn't work....
                                Could you help me out please?


                                texture trick on curved surface.skp

                                WEB (ita) - https://filipposcarso.wixsite.com/ordinentropico

                                1 Reply Last reply Reply Quote 0
                                • TIGT Offline
                                  TIG Moderator
                                  last edited by

                                  I don't think it's suitable to do what you want.
                                  Can you explain [in simple steps] what you have, and what you'd like to achieve.
                                  I can't understand your 'containers' and materials on faces etc exactly.
                                  Why isn't the material on the curved surface, rather than the instance ?

                                  Also your component seems to be a DC... and if I copy an instance of it, then a new definition gets made for that copy... 😲

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • P Offline
                                    pibuz
                                    last edited by

                                    Hi TIG! Thanks for you quick answer!

                                    So, what I'm trying to achieve is the possibility to change the texture applied to the component, so that in my render I can replace it with whatever texture and it gets rendered fine, without the need of entering the component and map the surface. This because I assume I will be using the same component a bunch of times, I have the need to have it reported by the SketchUp report tool, but I want it to be aesthetically different, so I'm keeping an inner component which is actually the same, and an outer shell which is painted with different textures (materials).

                                    I've already achieved this in the file I'm attaching (it's a DC, see how it works in the options window, sorry it's in italian), working with a flat plane. Basically one have to set the dimensions, create a sketchup material using a texture with the desired dimensions, and apply that material to the face, which automatically gets mapped on that face.

                                    I'm trying to figure out how to do the same thing on that hell of a curved surface πŸ‘Ώ


                                    grafica CoverUp.skp

                                    WEB (ita) - https://filipposcarso.wixsite.com/ordinentropico

                                    1 Reply Last reply Reply Quote 0
                                    • TIGT Offline
                                      TIG Moderator
                                      last edited by

                                      The only solution I can see is a manual one.
                                      Explode the scaled instance and immediately make a new component from it ?
                                      It keeps the scaling etc, transferring the material to the reused surface...
                                      But any DC-ness gets lost !

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • P Offline
                                        pibuz
                                        last edited by

                                        Thanks anyway TIG for taking your time to answer!

                                        WEB (ita) - https://filipposcarso.wixsite.com/ordinentropico

                                        1 Reply Last reply Reply Quote 0
                                        • Y Offline
                                          yeehaa123
                                          last edited by

                                          Thanks a lot, TIG
                                          It's been 10 years...
                                          I think you need to replace the lines
                                          ts=Geom::Transformation.scaling(ct, 1.0/tx, 1.0/ty, 1.0/tz) c.transform!(ts) ### reset scale
                                          with
                                          c.transformation*=Geom::Transformation.scaling(1.0/tx, 1.0/ty, 1.0/tz)
                                          Because when there is a rotation transformation, it does not work correctly

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

                                          Advertisement