Chemistory Level and Net Code

Chemistory over the past couple weeks got a few new features, the biggest being an actual level and client/server networking code (or at least the start of it).

There’s a separate build for client (Browser) and server (NodeJS), both of which run THREE.js and Oimo.js, though the server doesn’t actually render anything. It took a switch to Gulp from Grunt, a pull request to WWOBJLoader2, and heavy use of ifdef-loader but it all actually talks to each other. Next steps are to add boilerplate for RPCs and member syncing and test out a little bit of multiplayer.

I really hope this goes quickly! I want to get back to game play and UI so I can start play-sharing it with my friends.

Powered by Hexo Logo Fursona by TFOTR

Cubecus for Blender is here!

Cubecus is here! After a long time coming (4 years on and off), I’ve gotten my Blender level design add-on into a releasable state (even though in alpha and with some glitches). Don’t worry though! It’s going to get better with more releases where I plan to separate out the obfuscator it uses into a separate project and add more features and fixes.

If you’re unfamiliar, give it’s page a look. It explains about the different tools it adds and provides screenshots of use (like the one below).

I hope that everyone who’s asked about it and even those who’ve not, find it useful :)

Importing and Reloading Python Modules in Blender

Using: blenderv2.7 pythonv3.5

Python in Blender can be tiring. A simple problem becomes an arduous trek through docs, examples, and sometimes the C API to find the Blender way to write given Python code. This is due to the many quirks of Blender’s own internal Python environment.

Importing is one of those arduous tasks. Python provides a lot of functionality to import all different kinds of source and data files but Blender’s implementation makes design decisions that create issues. This is my deep dive into Blender’s Python import integration where at the end I provide a small module to make your future Blender importing life easier.

Importing

In a nutshell, Python’s module importing/loading comes bundled in the from ... import ... as ... syntax. This syntax ultimately compiles to various forms of the __import__() function. Instead of interfacing with this directly, Python provides importlib in Python 3.4+ (previously imp in Python < 3.4) to make interfacing with __import__() much easier. Blender decides to forgo this setup for its own implementation with the intention of making their own integration work better with the way Blender handles its data. This allows it to support nifty features like code files being text datablocks and inline python snippets in other parts of the application.

Compiling Blender as a Python Module for Windows 10 x64 using Visual Studio

Using: blenderv2.78 pythonv3.4 or v3.5

If you want to do unit tests of Blender Python code, it might be to your benefit to not startup Blender every time you want to run them but to just import Blender as a Python module and run them from the command line. This is especially important/nice if you want to automate your tests. Note, before you jump in, if you just need mathutils you can get that separately here.

Luckily, Blender’s build has a nifty feature by which you can compile it as a Python module and then import blender from Python…

1
2
import bpy #Starts up Blender as Python module
from mathutils import Vector #Import a Blender specific library

Unfortunately for me, all of the tutorials I found were not geared toward the target I was looking for: Blender 2.78, Windows 10 x64, Microsoft Visual Studio Express 2013+, and Python 3.5. After a couple days I was able to get it all building and working with this tool chain and it should work just as well for x86, a different Python version, or a different MSVS version.

Some more rendering stuff

Continuing from my last rendering post, the spider mini boss in “Quackventure” shoots these little energy balls at the player. I added the energy ball after the render in Paint.NET to get this neat little scene.

It only took a couple hours of work and I got such a nice result for the time spent! Didn’t think it would be this easy given that I’ve never performed a render before. Thanks cycles!

Anyway, the picture above is the final render in 1920x1080, enjoy.

Another 4am Blender night...

This is a product of another 4am night playing around working with Blender’s Cycles renderer for some art for a song.

My friend ended up giving me some models from his game “Quackventure” for the album art (the song is called Mini Boss, these are a Mini Boss from his game). I retextured everything, made a scene for the little spiders, and had fun posing the little eyes and sculpting the rocks and the webs. The rendering above is just a quick progress picture as the final render is currently rendering in the background.

I’ll post the final one in the morning when it’s done and the song sometime soon.