cr2bone_import.py

Purpose

To construct Blender armatures from Poser CR2 file format "actors" (bones?).

Overview

I have no idea what the true purpose of the CR2 file is for, but it contains bones information. I managed to import an associated model file (OBJ format) successfully, and I was not in the mood to rig a skeleton in Blender. So I decided to write an importer instead. I used information linked from BlenderWiki's page on file formats: http://mediawiki.blender.org/index.php/File_format_list

This a proof-of-concept module for importing some, but not all, Poser data, mainly just the bones. I leave it to more qualified coders to tidy up this morass of python into a passable Blender script.

Usage

The coding structure is similar to my md3importer: a "backend" module to churn all the data, and a "frontend" that uses the first module to play with Blender.

I've grown a little out of touch with the Blender coding environment, so I have no idea what the proper procedure is for installing scripts. The script (cr2bone_import) can be run anywhere, or placed in ~/.blender/scripts/ to make the menu happy (File->Import).

Limitations and Wishlist

The python API in Blender 2.40 for armatures is required, which is why 2.40 is minimum.

Much of the file content is ignored. Among the more scrumptious tidbits encoded in the CR2 file format (which I probably won't get around to implementing):

Stuff that would be nice (but I probably won't have time to get to):

Programming Notes

The "parser" is very fragile. It makes too many unwarranted assumptions about the CR2 file format.

Lot of copy-and-paste code. I'm not happy about it.

BPY header stuff and GPL boilerplate based on (copied from) OBJ Importer by Campbell Barton.


Downloads

2006.01.06
cr2bone_import.py, Blender importer for bones in CR2 format.

(cr2_parser.py, CR2 format parser as a separate module/script (not required)).


Last updated 2006.01.06

Frederick Lee <phaethon@linux.ucla.edu>