Wednesday, March 12, 2008

Blender Materials and Python


I spent some time tonight working with Blender on an illustration of DNA. At first, I thought it would be straightforward... I soon realized there were many challenges. The biggest was setting up the nucleotides. They have to be four different colors, representing the pair A and T, as well as C and G. The pairs need to go together. Since there were so many of them, I thought this was a good time to do a little Python. After poking around in the APIs, I found where I could set the Object's material. I ran my script and nothing seemed to happen. As it turns out, Blender can associate a material with an object or a mesh. By default it associates with a mesh and it seems that the mesh material takes precedence over the object material. A small change to the code and I got it working. Here's the program:

import Blender
from Blender import Material, Mesh

objects = Blender.Object.GetSelected()
mat = Material.Get("T_Nucleotide")

for curObj in objects:
n = curObj.getData()
n.materials = [mat]
n.update()
curObj.layers = [5]

The code starts out with the import statements to use the Blender, Material, and Mesh modules. Next it gets all the selected objects (this way I could click on the ones I want to change). Then it sets a variable to the material I want to use. I loop through the list of objects getting the mesh data, then setting its materials. Note that the materials property is actually a list of materials, so I add the brackets around the material variable. I call update() so the screen is updated. Lastly, all the ones that were changed I move to layer 5. The layers property is list, this is a neat feature of Blender... unlike most graphics programs where an object can only reside on one layer at a time, in Blender you can set the object to appear on multiple layers. Turns out to be very useful.

Monday, March 10, 2008

FlexBuilder vs FlashDevelop

I've been using both FlexBuilder and FlashDevelop at work lately. I'm a long time FlashDevelop user, so I've a little bias towards it. Lately, I've been trying to look at FlexBuilder with regards to its strengths. I've found that if I am doing a lot of MXML coding, FlexBuilder is a better tool. You have a class view of the MXML and it is good about hinting for MXML attributes. If you need to do absolute positioning, FlexBuilder also wins because of it's WYSIWYG editor.

But when it comes to ActionScript 3 coding, I'd much rather be in FlashDevelop. FlashDevelop's code hinting is much more powerful, for example it does NOT require you to type exactly the right characters. It's a breeze to jump around to declarations of code as well as nice features for creating getters/setters, promoting local variable to member variables, and creating event handlers. The look and feel of FlashDevelop is also nice, it launches and runs quickly. It has good defaults, a user-friendly UI, and good choices for fonts (I guess that could fall under "good defaults"). FlashDevelop is also free.

Monday, March 03, 2008

Blender Basics Course


My first course for CartoonSmart.com was launched today: Blender Basics! I've been a fan of CartoonSmart.com's Flash tutorials for many years, so I was honored to be asked to do Blender courses. CartoonSmart.com produces high quality training for a great price.

Blender Basics is for folks who've never used Blender before. It is a gentle introduction to a very powerful, open source, 3d program. In it I try to address the concerns I had when I first downloaded it. The interface is very different than most Mac or PC programs. Once you learn the basics though, you'll like it. It is very fast and highly configurable.

After learning some of the basics of the interface, interacting in the 3d space, setting up your workspace, saving and loading, I show you how to make a 3d character scratch, just starting with a sketch. I cover modeling and finish up with introduction to materials and rendering.

The video high quality, it is compressed using the H.264 codec at Best quality, Millions, 1024x768. The audio is AAC 44.100kHz. The only place to get it (legally) is CartoonSmart.com. CartoonSmart.com and I will be donating a percentage of the profits to the Blender Foundation to support further development of Blender.

Tuesday, February 19, 2008

Paging vs Scrolling - Aesthetic and Functional Considerations

Recently, while working on two different Flash projects, I had to deal with the idea of paging vs scrolling. I've encountered both types of UI treatments countless times over the last 20+ years, but I've never thought too deeply on the subject. Yes, I've been irritated by Flash sites with tiny scroll boxes. And I've been irritated by HTML pages that page the info instead of just letting it flow in my browser. But now I found myself thinking actively about the issue of paging vs scrolling.

So I Googled "paging vs scrolling" and sure enough, it's been looked at and studied. The studies do not use very large numbers of participants, so I'm hesitant to put too much stock in them. My focus on paging vs scrolling is for a very specific context, fixed sized-Flash movies with static content. There are aesthetic and functional reasons to choose paging in this situation.

How many times have you been faced with a Flash site where there were tiny scrolling boxes with non-standard scrollbars? Even though your monitor may have plenty of room, you're forced to scroll (it just feels wrong and looks bad). If you're delivering text to a small, fixed area, this is where paging looks and works better in a Flash movie where the text is already pre-loaded. A problem with paging in HTML is that it relies on a request back to the server each time you want to flip to a new page.

Back in the old days of newspaper and magazine design and layout, if you had a blurb of text that exceed the space, you'd refer the reader to another page. It is a convention that is familiar. On the web (and in Flash), it can work even better as it allows the reader to immediately jump to the next passage (as opposed to searching for it and perusing ads), as well as easily jump back. You could make a similar case to scrolling but it doesn't hold up aesthetically in the case of Flash. Whereas with paging, you could have more than one article on a screen of a Flash movie that the user can page through and it will hold up from a design perspective, but imagine multiple scroll boxes (*gasp* I've seen such things).

Fixed-size layouts is only part of the justification for paging in Flash. Another element is whether the content is static. If the content for a story is fairly static (minor edits aside), paging works well. If the content is in flux--where the text on each page is changing in the story so it is flowing differently--I think a scrollbox is more appropriate.

People do more than just read words when they look at a page. They see the shape of the paragraphs, lines, words, and character forms. Flipping through pages can take advantage of this if the text is not constantly changing. A similar form of visual and spatial memory is used when you go back to a favorite passage in a book. But in this scenario, I'd be tempted to avoid a fixed-sized Flash for HTML or another fluid medium like Flex.

Sunday, February 10, 2008

Adobe CS3 Rant - Part 2

I just transfered my Adobe CS3 software to my new system. After my horrible experience with it last year, I was a bit nervous. I de-activated the suite on my old system and installed it on the new one. The install only took a half hour, far better than last year. Apparently, Adobe QAs on new fast systems that are untouched.

The fun came when I tried to enter my serial number. It took my serial number but it then wanted proof that it was an upgrade since it couldn't find CS2 on the machine. It asked me to enter a serial number for either CS2 or CS2.3 Upgrade. Since my CS2.3 box says "Upgrade" on it, I tried that one first. It did not recognized the number. So for the heck of it, I tried the other option (CS2) and it worked. But then another input field appeared and it asked me to enter another serial number. This time the only option was CS2.3 Upgrade (the one that did not work), which does not work.

So I get on the phone and give Adobe a call. Being a Sunday evening, the wait was not that long. I try explaining my situation to the customer service person who's native language is not English, does not speak clearly (slurring), and has no real desire to solve the problem. He transfers me to a helpful pre-sales person (who chuckles when I tell him I was just transferred from customer service). He seems to think that the software deal I got when I bought it is unusual for some reason, even though I bought directly from Adobe for CS2 and CS3. He sends me back to customer service with the instructions to request for re-serialization. While back on hold, I'm playing around with the verify screen and I enter in serial number for Acrobat Pro that came with my CS2.3 Upgrade, it works! I quickly hang up, narrowly avoiding another experience with customer "service". Now I'm left with pondering why they ask for a CS2.3 Upgrade serial number when they really want an Acrobat Pro number... What has happened to Adobe? They're sure making a great case for open source software.

On the upside, after I got everything running, I poked around on the CS3 Content disk and found that Illustrator CS3 has Wacom 6d Pen support. In the Goodies folder there is an Illustrator file with a small variety of brushes that work with the 6d Pen, and they work nicely. I saved them out as a library for future use. Why doesn't Photoshop CS3 have 6d Pen support yet?

Monday, February 04, 2008

Dino Fun


I'm having fun with my new HP Pavilion M8330F. Here I'm testing the limits of rendering in Bryce. The image above rendered quickly. The dinosaurs I got from DAZ. DAZ is a great resource for 3d models. Their DAZ Studio software is similar to Poser, but they give it away. It has some integration with Bryce and they're working on Photoshop CS3 Enhanced integration (the software is in public beta).

I have not had time yet to go through the laborious deactivation and re-installation of the Adobe CS3 Studio yet (the install alone takes hours). So I also used the free Paint.NET to crop the image. Paint.NET is an imaging editing program that is very full-featured, yet only 1.5MB to download. It is fast and has a nice interface, too.

Friday, February 01, 2008

From SketchUp to Bryce

At the beginning of the year, Mitch Lopata of Lopata Design introduced to me to Google's 3d Warehouse. It has an impressive collection of 3d models that were made with SketchUp. He wanted to use some for reference but his program (Silo), could not open the SKP format, nor could it import the KMZ format (which SketchUp will export to). Knowing I used Blender, he asked if I could import them. As it turned out, Blender right out of the box cannot, but (similar to my ASE scenario) there is a Python script for Blender to read KMZ files. After bringing it into Blender, I was able to export it as an OBJ, which he could then import to Silo. So here are the steps to go from KMZ to OBJ.
  1. Open SKP in SketchUp
  2. Export to KMZ
  3. Import KMZ to Blender
  4. Export as OBJ
Today, I told a co-worker about 3d Warehouse and it wasn't long before he found something useful. He asked me if I could bring it into Bryce. I followed my steps above, but the objects came in entirely black. So for the heck of it, I brought the OBJ into DAZ Studio (DS). They rendered fine in DS so I used the DS link from Bryce to DS to get the blocks from DS. Then they rendered with fine, go figure. So the revised SketchUp to Bryce process:
  1. Open SKP in SketchUp
  2. Export to KMZ
  3. Import to Blender
  4. Export as OBJ
  5. Import to DAZ Studio
  6. Open Bryce and click the Launch DAZ Studio button
  7. In DS select Return to Bryce
It's funny, I just bought Bryce last weekend. I'd been away from it for 14 years (since version 1.0). It is now on version 6.1. At first the UI seemed unfamiliar, but as I worked in it tonight it started coming back to me. The interface has not changed much, I'd just been away too long.

About the image: The image above was created with Blender and Bryce. I modeled the face in Blender, imported it into Bryce using the technique above (OBJ to DAZ to Bryce), added materials and rendered in Bryce.