Monday, June 27, 2011

Curves, Regular Expressions, and Blender Data Pages


This was a pretty busy week that saw a lot of victories and interesting developments on small projects and experiments. Here are some of the highlights of what happened.

String It
Last week saw the release of String It. String It is a Blender add on that generates curves that run through the center of selected objects. Right now, it just supports bezier curves though future revisions could support other spline types. Also, it might one day include support for automated hook modifiers to bound the the objects to the curves that run through them.

Regular Expressions Challenge
Repetitive work involving removal of Amazon anchor tags inspired a scripting project to automate those kinds of tasks. A practice challenge with regular expressions on an old copy of one of my PHP files was called for. The project ran into some problems. For example, what does one do if there are two sets of anchor tags on the same line being evaluated? An oversimplified expression might match both sets along with any text between them. It's interesting enough to merit further investigation.

Blender Data Pages
One of last week's projects confirmed that it is possible to have a server script invoke Blender in a way that lets the script print blend data on a web page. The project only required a PHP page, a blend file, and a few lines of Python. While it was easy to do, security concerns prevent me from making a full project for production. Still, the idea of something called "Blender Data Pages" does have a nice ring to it.

Generator for Uncle Squirrely
Usage of the any() function in Uncle Squirrely's database update script made the code cleaner. However, that meant evaluations on whether or not a game belongs in the database had to go into lists. Since every evaluation in the list has to be evaluated, that caused an efficiency hit. Sacrificing performance for code aesthetics was not a good trade off.

Lazy evaluation courtesy a generator function is the best of both worlds. Basically, all I needed to do was put all my evaluations in it's own function. If you put yield statements between evaluations, what you get is a function that can be iterated on the same as you would with a range function. It was easy to learn, easy to implement, and lead to lazy code that looked great. All projects should be that easy.

Other Little Things
In the near future, Blender PythonTutorials will be an add-on focused site. Moving the add-on scripts link to the top is one step toward that goal.

Last, but not least, I have a special lambda utility I like using for searching module properties.  The problem is I found myself rewriting it everytime I needed it. Finally getting around to putting it in my PYTHON_PATH reduced that typing to an short import statement. It also made the utility available both in and out of Blender related Python projects. It should have been done sooner.

As you can see, it was a pretty busy week. I learned a lot, put good stuff out there for users, and got inspired to explore other ideas. These are the things that make software development the worthwhile endeavor that it is.


Sunday, June 12, 2011

The Teacher is a Maker Now


The week's theme was on setbacks and moving forward in spite of them. Let's review what happened.

Broken Microphone
My microphone no longer records intelligible audio.  This killed the voice part of recording for the GUI and Panel Basics video tutorial.  Lack of money for new equipment forced a change of strategy.  Annotations acted as a substitute for audio.  Well-timed notes and speech bubbles made the video shorter. While these got the job done, I'm not sure more video tutorials with this limitation are worth it.  Because of the limited value of making new tutorials at all, I think I should call this latest one my last.  It's time to focus my efforts where they'll do the most good.

Losing Amazon Ads
There are no more Amazon ads on my site because I live in Connecticut.  My governor passed an affiliate sales tax law.  Amazon is now supposed to levy my state's sales tax if users arrive there via my site.  They didn't like it so they closed my account along with every other Amazon associate living in Connecticut.

This makes for an interesting problem.  To find a replacement affiliate program, I'd need something that dealt in books and computer hardware.  Also, they would have to be widely known and trusted.  Thirdly, they'd have to tolerate my state's affiliate tax.  That's a pretty tall order.  It's likely easier to figure out a business plan that doesn't need affiliate programs.

Moving Forward on Python Developments
The setbacks got me thinking more about writing code.  A better version of my animated mesh mangler now sits in the script section of my site.  I submitted my pyramid generator script to the Blender tracker for consideration in the next Blender release.  I've also started playing around with curves in the Blender API.  It'll be interesting to see how this all turns out.

What This Week Drives Home
The good thing about losing Amazon and my microphone is how it pushed me change priorities.  The transition from tutorial writing to development is complete.  For better or for worse, the teacher is a maker now.  Maybe the change was overdue.

Sunday, June 5, 2011

Thoughts on Python, Marketing, and the Future


I have a confession to make.  I'm a better programmer than I am a business guy.  However, much of the focus last week was on marketing, design, and the business angle of Blender Python Tutorials.  Here is some of what happened and the conclusions I came to.


Marketing and Design
Advertising is a key component to marketing with Blender Python Tutorials.  Failure of past ads to generate revenue lead to changing to an approach based on text ads instead of graphical ones. More layout improvements with respect to ads may also improve the situation. Time will tell how effective this will be. However, even if it fails, the site design is still improved over what it was.

Knowing one's audience is also an important part of marketing strategy.  Time with the Blender Artists forum helps me better understand the concerns of other script developers. My posts include a tag line that links to my site which helps drive traffic. However, I only post when I have an answer to give or something real to share. Otherwise, I lurk quietly and listen.

The Business Plan Is Wrong
My business plan focused on training on a specific case of software-embedded Python. The idea was to make ad money on tutorials and the occasional example script. It failed.  Some research as to why was in order.

Here's what I noticed. Python is embedded in a lot of software projects. Blender, Inkscape, GEdit, Houdini, and Gimp are a few that come to mind. Those projects reaped the benefit of hundreds of extensions and plugins. These improvements may not have happened to this magnitude had the developers not made the decision to embed Python into their code bases.

However, a few Google searches on tutorials for Houdini Python, Inkscape Python, and so on produced some interesting results. Results ranged from single blog posts to master classes. What I did not find were successful businesses based solely on script training for a specific application.

There is a reason for that. Once you know a programming language, any good developer will pick up what they need as the need arises. This isn't to say tutorials are a waste of time. However, most learning comes from looking at examples and API references, asking questions, and writing your own code.

The Future of Blender Python Tutorials
My time spent working on Blender Python Tutorials was worth it. The site is a good resource and I'm a better programmer for having done it. It's also my way to give back to the Blender community that made such an excellent 3D package free for me to use.

However, there is only so much further my tutorial site can go. There is still more Youtube work to be done. Aside from that, the focus will shift more to developing software that's useful and solves real problems. Come to think of it, there might be a business plan in that.