SketchUp: How to assign materials to groups and components

Everybody knows that faces in SketchUp can be painted with different materials. What lots of folks don’t know is that you can apply materials to groups and components, too. The following illustration shows the Entity Info dialog box, which is a great place to see which materials are applied to your geometry.

The Entity Info dialog box (Window > Entity Info) shows thumbnails for the materials assigned to selected entities. When you select a face, it shows thumbnails for the front and back sides of that face (top). Groups and components have material thumbnails, too (bottom).

 

When you paint a group or component red, only the faces inside it that are painted with the Default* material turn red. Faces that have already been painted with another material don’t change at all.

The above group (top) includes faces that are painted with different materials (bottom). Only the top face is assigned the Default material.

 

Applying a material to the entire group only changes the color of faces that are painted the Default material.

 

This trick also works with groups and components that are nested inside one another. When you apply a material to a top level group or component, all the Default-colored faces that are inside nested, Default-colored groups and components inherit that material automatically. The following diagram is my best attempt at a visual explanation of this phenomenon.

Applying a material to a group or component that in turn contains sub-groups and component instances can be a confusing experience. Just remember that the color you’re painting “trickles down” to Default-colored faces contained within Default-colored groups and components. It’s easier done than said : )

 

*SketchUp automatically applies the Default material to faces you create from scratch. You can also paint anything with the Default material at any time; just pick it in the Materials Browser (which looks completely different on PCs and Macs.)

The Windows and Mac versions of the Materials Browser. On the former, the Default material is included as a permanent thumbnail; on the latter, it’s the first material in the “Colors In Model” list.

 

As you can see, this technique is a godsend for building complicated objects that need to change color easily. In the case of the George Nelson Marshmallow Sofa in the images that follow, the cushions are individual component instances nested inside the main Sofa component. These are assigned the Default material.

I downloaded this George Nelson Marshmallow Sofa component from FormFonts.

The individual cushions are instances of the same component. Each instance is assigned the Default material.

The faces that make up the surface of each cushion are also painted with the Default material.

 

All of the metal and rubber frame pieces are also groups and components, but their faces are all assigned specific materials.

The faces in the non-cushion parts of the sofa are all assigned materials other than Default.

 

When you use the Paint Bucket to paint a color—in this case orange—on the main Marshmallow Sofa component, only the cushions take on that color. Everything not assigned the Default material stays exactly the way it is.

Painting the sofa component orange causes all Default-painted faces to turn that color. Non-Default-colored faces remain unchanged.

SketchUp: The New England Aquarium

April Phelps is a LEED-accredited designer who works at the New England Aquarium creating new exhibits and enhancing existing ones. Boston’s New England Aquarium is one of the many non-profit organizations to which we’ve granted SketchUp Pro licenses as part of the SketchUp for Nonprofits program.

SketchUp Pro has been a big help to us in the New England Aquarium Design Department. The Aquarium was founded in 1969 and attracts over 1.3 million visitors a year to our waterfront location. Recently the Aquarium’s capital improvement plan called for a complete renovation of our changing exhibits space, and we decided to part with the Aquarium’s traditional design aesthetic and embark on a new path.

Families touching the rays in our new shark and ray touch tank exhibit

 

The newly completed exhibit we designed in SketchUp Pro is called The Trust Family Foundation Shark and Ray Touch Tank. It features sharks and rays in a mangrove-themed tank surrounded by shallow edges and viewing windows, allowing visitors to experience a close encounter with these animals.

The exhibit presents these incredible species in a way that highlights their importance in a healthy ocean ecosystem. It also emphasizes the value of conserving essential coastal habitats, such as mangroves and lagoons. During evening hours the new space is also used as an event venue for private functions.

View from the entrance of the shark and ray touch tank. On top is our design phase
rendering; below is an opening day photograph.

 

The Aquarium provides unique challenges for designers. We have a variety of internal clients with different needs, and we need a modeling program that works quickly and accurately to convey our ideas. SketchUp’s quick modeling capabilities provided me the extra time needed to explore multiple design options on this project.

SketchUp also enabled our design team to give everyone at the Aquarium a sense of the new exhibit’s aesthetics quickly and easily. In addition to quickly creating renderings, we imported actual material samples into our models. This allowed staff and visitors to get a sense of scale and of how significant the interaction with animals would be.

View from inside the exhibit towards the Lagoon and Cassiopeia tanks. Above is
our design phase rendering; below is an opening day photograph.

 

Our traditional design aesthetic for the Main Building is to make the visitor feel like they are submerged underwater, looking through portals to all the fish. The new exhibit needed to be airy and bright, allowing visitors to feel that they are no longer submerged but at the beach level interacting with the animals. To achieve this we revealed the once covered up skylights and installed a significant amount of energy efficient lighting. With natural and artificial lighting we simulated the feeling of wading around a beach touching sharks and rays.

View of The Trust Family Foundation Shark and Ray Touch Tank Gift Shop. The top image is our design phase rendering; below it is an opening day photograph.

 

This “no surprises” methodology allowed us to receive design input from different departments quickly. Given our very tight schedule and lack of resources, it proved to be most helpful. We’re excited to continue to use SketchUp Pro on future projects and renovations at the New England Aquarium.

PHP and UTF-8 BOM

I recently wrote some PHP for the first time in ages, and noticed some of my pages were appearing on one development machine, in some browsers, preceded by the characters . These characters didn’t show up when editing the pages, and they didn’t show up at all when served from a different server or when viewed in some other browsers.

Initially, I thought that it was something to do with not having configured the correct character set in the response header (which is generally the main cause of garbled characters appearing in webpages), but, checking the response header it seemed ok – I was outputting UTF-8 as desired:

[php]header(‘Content-type: text/html; charset=UTF-8’) ;[/php]

And browsers viewing the page were correctly auto-detecting the character encoding as UTF-8:

 


 
image

Then I checked the configuration of the server, which was also set up with Unicode support correctly. And then I checked the encoding of the PHP scripts themselves, which were all encoded using Unicode UTF-8 – (Windows Codepage 65001). So far, everything seemed consistent, so where were those garbled characters coming from?

UTF-8 with or without signature – your choice. (Or not).

The reason, as I found out, was that one of my development environments (Visual Studio – from which I’d made the most recent edits to the affected pages) was configured to save UTF-8 encoded files with signature. Here’s the options for Unicode character encoding in Visual Studio, showing UTF-8 both with and without signature (notice that they’re both the same codepage – 65001):

image

There seems to be very little convention or standardisation as to the use of this “signature”. I hadn’t really come across this problem before because I generally use Eclipse for PHP development. The encoding options there are shown below:

image

Notice that, although there are several flavours of UTF-16 available in Eclipse, there is only version of UTF-8, which is equivalent to Visual Studio’s without signature.

Then again, here are the options in Windows Notepad (yes, I use that sometimes as well). As in Eclipse, there is only one choice of UTF-8, but this time the sole option available  provides the opposite behaviour – always saving UTF-8 with signature:

BOM BOM!

The optional “signature” in question is the Byte-Order Marker, or BOM. A byte-order marker is required for multibyte encoded data, including UTF-16, to indicate big-endianness or little-endianness – the order in which bytes are arranged. All of the save dialogs above give you the choice for specifying the byte order for Unicode UTF-16, since in a multibyte format the byte order matters. However, for UTF-8, which uses only a single byte for each character (that’s what the “8” stands for – 8 bits = 1 byte) a BOM is not required and doesn’t really make sense.

Even though UTF-8 always uses the same byte-order, a UTF-8 encoded file can begin with the bytes EF BB BF, which merely signifies that it is in UTF-8 format. It’s not really a BOM, hence why Visual Studio calls it a “signature”. The problem is that some clients don’t expect UTF-8 to have a BOM and, as it turns out, the PHP engine is one of them. At least,some builds of the PHP engine. One of my PHP servers, running on a linux machine, interpreted the UTF-8 file with signature fine, whereas another, running under Windows, tried to display the leading bytes as content on the page, which is how you end up with .

The combination of different default encoding behaviours across different editors combined with different server/browser behaviours when interpreting UTF-8 files with BOM means that this problem can be a little tricky to diagnose.

This is reported as a PHP bug at http://bugs.php.net/bug.php?id=22108, but the workarounds are actually quite straightforward (once you know what the problem is!):

  • If you’re using Visual Studio, make sure you save your PHP files as UTF-8 withoutsignature. If you’re using Eclipse, this is the default anyway.
  • Compile your PHP with the –enable-zend-multibyte option, which will correctly parse the BOM at the start of the file
  • If you don’t need unicode at all, you could use ISO-8566-1, or another non-UTF-8  encoding