• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

How to assign a material to all selected objects (and faces)

Scheduled Pinned Locked Moved Developers' Forum
11 Posts 3 Posters 5.2k Views
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.
  • A Offline
    AcesHigh
    last edited by 5 Oct 2009, 20:06

    Let me explain it properly... when you want to assign a glass material to a Sketchup object to render in VRAY, you need to assign it to all the faces of the glass. That means that if you assign the glass to one face, but the other face has not the same material, then the glass pane wont be transparent from the other side.

    The situation becomes specially annoying when you are dealing with glass panes that have volume... since to paint the INSIDE faces of the glass, you have to position the camera inside the 5 millimeters thick glass... and then paint the glass from the inside!!

    If you do not paint the INSIDE of the volumetric glass panel, one face will be transparent, but the back face on the other side will be opaque, with the default material.

    I tried double clicking on the glass pane, or selecting it all and painting... but it never works. If I check the entity info, and I click on a face, it shows two materials... the glass material (for the exterior) and the default material, for the interior face.

    Its true that from the Entity Info I can click on the default material and select the glass material... but thats incredibly tedious for many different glass panes (when they are not a component)...

    So, is there a SIMPLE AND FAST way to paint the inside and outside faces of an object (in this case, glass panels)? If there isnt, can a plugin be made to solve the issue?

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 5 Oct 2009, 20:28

      Select the faces you want to paint and use the Entity Info to paint the back side of the faces. You see the two material slots when you select only faces - you can click on them to assign a material.

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

      1 Reply Last reply Reply Quote 0
      • A Offline
        AcesHigh
        last edited by 6 Oct 2009, 02:14

        Thanks Thomthom, but I mentioned that in the last part of my post.

        The problem with this method is that having to select each of the 2 faces of a solid glass pane is counter-productive to say the least, making you change the camera to bad positions just to select a face, etc.

        But worst than that is the fact that changing materials by clicking on the slot inside the Entity Info is TERRIBLE!!! You have to click on the slot, FIND the material on that horrible small window... it would be much easier if AT LEAST you could use the eyedropper tool (like you do in the normal material window) or just drag and drop the material...

        But the fact is that, for MULTIPLE OBJECTS, having to select each face I want to set the same material to both sides, then clicking the slot at the entity info, then finding and assigning the correct material, is TERRIBLE.

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 6 Oct 2009, 06:30

          @aceshigh said:

          making you change the camera to bad positions just to select a face, etc.

          Don't see why you need to change the camera position...
          Just position your camera somewhat facing the window, right-to-left select so that it selects both the faces.

          As for applying materials to the backface; yes, the entity can be awkward when you have lots of materials.
          I use this plugin to transfer front-material to back-material: http://forums.sketchucation.com/viewtopic.php?f=180&t=14684
          Assign it as a hotkey and it's done really quick.

          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
            thomthom
            last edited by 6 Oct 2009, 06:32

            Mind you, I've been annoyed by the native SU paint bucket that opens the material window every frickin' time. I've been meaning to make a custom paint-bucket that does that. And I figured I could them add functionality to paint front-and-back side. As well as clicking group/components and have the faces inside painted.

            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
              thomthom
              last edited by 6 Oct 2009, 06:34

              @runnerpack said:

              One thing I've found handy when working on "solids" in SU is to have "Hide" assigned to the H key and "Unhide last" assigned to the U key. If you want the back of an inside face, click the front face, 'H'ide it, mess with the back of the other face, 'U'nhide it. You can get quite fast at it with practice. πŸ‘Š

              Another way is adding a shortcut to the Reverse Face function. Then you can paint the front face, Reverse, Paint the back, Reverse - Bob's your uncle.

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

              1 Reply Last reply Reply Quote 0
              • R Offline
                RunnerPack
                last edited by 6 Oct 2009, 06:38

                Here's a one-liner that will paint the backs of any face with a certain material on the front:

                Sketchup.active_model.active_entities.each { |e| e.back_material = e.material if e.material.name == '<put_name_here>' and e.respond_to?('back_material=') }
                

                (NB: The 'name' method returns nil instead of 'Default' for the Default material.)

                Just put the name of your glass material where is says <put_name_here> and paste it into the ruby console to run it. It could be made into a full plugin fairly easily.

                I'm not sure about automatically painting the face on the back of the "pane", though. Maybe a ray-test followed by a comparison of normals and dimensions... sounds quite difficult and slow.

                One thing I've found handy when working on "solids" in SU is to have "Hide" assigned to the H key and "Unhide last" assigned to the U key. If you want the back of an inside face, click the front face, 'H'ide it, mess with the back of the other face, 'U'nhide it. You can get quite fast at it with practice. πŸ‘Š

                You might have noticed... I'm a bit of a ferpectionist.

                1 Reply Last reply Reply Quote 0
                • R Offline
                  RunnerPack
                  last edited by 6 Oct 2009, 06:46

                  @thomthom said:

                  @runnerpack said:

                  One thing I've found handy when working on "solids" in SU is to have "Hide" assigned to the H key and "Unhide last" assigned to the U key. If you want the back of an inside face, click the front face, 'H'ide it, mess with the back of the other face, 'U'nhide it. You can get quite fast at it with practice. πŸ‘Š

                  Another way is adding a shortcut to the Reverse Face function. Then you can paint the front face, Reverse, Paint the back, Reverse - Bob's your uncle.

                  Yes, but I was referring to the face "behind" the face you're looking at. Like getting to the backface of the back of one of AcesHigh's window panes:

                  Assuming a pane made of two faces A and B:
                  Camera -> Front of A|Back of A <-space-> Back of B|Front of B

                  Hide A to get to the back of B.

                  You might have noticed... I'm a bit of a ferpectionist.

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 6 Oct 2009, 06:52

                    Using the hide method you then have to do it again for the other face again.

                    If you do a right-to-left selection drag so both faces are selected,
                    then when you click the front face of one of them, both get painted,
                    reverse
                    paint the back, again both gets painted,
                    reverse

                    That way you don't have to repeat so many operations.

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

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      RunnerPack
                      last edited by 6 Oct 2009, 06:56

                      @thomthom said:

                      Mind you, I've been annoyed by the native SU paint bucket that opens the material window every frickin' time. I've been meaning to make a custom paint-bucket that does that. And I figured I could them add functionality to paint front-and-back side. As well as clicking group/components and have the faces inside painted.

                      Argh! Don't get me started on how annoying that is! I would be soooo grateful if you made a new paint-bucket tool! Also, some way of showing which material is selected would be handy... (but not in a floating window for obvious reasons πŸ˜‰ )

                      Also, good job on that "copy material to the other side" tool.

                      You might have noticed... I'm a bit of a ferpectionist.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 6 Oct 2009, 06:58

                        @runnerpack said:

                        Also, some way of showing which material is selected would be handy... (but not in a floating window for obvious reasons πŸ˜‰ )

                        I could draw the name of the material to the viewport, as well as a sample of the colour (but not texture).

                        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
                        1 / 1
                        • First post
                          1/11
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement