* Wasn't setting the curve 3D option
* The nurbs object name could be None which caused an error, check its set.
OBJ Export
* Off by 1 error on closed nurbs was incorrect, broke other importers but worked with blender.
* Nurbs verts were not adding to the total vert count, scrambling meshes added after (somehow my first test case had all the curve objects last)
Imports nurbs with orderU and endpointU (inferred from weights).
No support for vert-weights, surfaces, 2D curves or non-bspline's yet.
fix for exporting closed nurbs, was overlapping too much of the curve.
from Paolo Ciccone (pciccone)
Im not that keen on this functionality since vertex groups in blender are for weight painting and OBJ's groups are more like sub-objects, The conversion between these is a poor approximation (one vertex group per face).
But this is still useful for using blender with poser so accepting these 2 patches.
Made some changes from the patch
*Export*
- vgroup off by default, since this is mainly useful for corner cases
- findVertexGroupName() - changed how exporting selects a vertex group for a face, use the highest combind weight for each group instead of the number of checking how many times the verts are in a group because they could have a zero weight.
- findVertexGroupName() - would fail if a faces verts were not in any groups, now return a (null) group
- Allow modifiers to export with vgroups
*Import*
- disable by default
- ignore (null) groups
- fixed a problem where the patch broke SPLIT_GROUPS
- move the group definition out of global namespace, breaks importing as a module.
--- Patch submission info
The import/export scripts included with Blender 2.48 don't save/preserve groups defined in OBJ file. This presents a
couple of issues: users loading an obj file with groups are not able to use a rather important set of data. When the
file is then saved the groups are lost bringing up both the issue of data loss and loss of functionality as groups are
used for rigging and morph target creation for Poser/DAZ Studio and all compatible applications. Of course other
animation/modeling packages that use OBJ files might be affected.
The solution that I present here simply patches the excellent python scripts written by Campbell Barton and Jiri Hnidek.
The new code implements the preservation of groups by creating Blender vertex groups during import and by re-writing
those groups in the OBJ file during export. Of course group ownership is idetermined at the face/polygon level and not
at the vertex level.
This rather simple solution makes Blender instantly one of the better tools to create Poser Morph targets (Full Body
Morphs) and conforming figures and clothing. Of course it's also adding a more complete support for the whole OBJ spec.
The patches are fitting well inside the established logic, have a minimal impact and are totally transparent to the
user. See the attached video (about 7 minutes long) for more details.
I noticed that the original scripts are formatted with tabs. I think it would be a good idea to follow the standard
Python recommendation and convert the scripts to use spaces. I didn't want to do it on my side as it would generate
a patch that replaces the whole file, not something that I wanted to do with my first submission :) But it would help
if people with access to SVN could do it.
Here is a short video that demonstrates the updates:
http://www.paolociccone.com/blender_obj_scripts.html
Cheers!
----
- renamed the 'morph target' option to 'keep vertex order'
- enabled 'keep vertex order' by default
This should improve usability for importing and exporting shape keys, point caches, mdds ,etc.
Maya uses OBJ's UV's to generate seams, some people complained that models imported from blender didnt work well in maya.
It was faster to write every faces UV (without doing a remove doubles), but sharing UV coords makes smaller files and might also be more efficient in other applications.
3ds_import - added option to disable recursive image searching (could be slow somtimes)
export_obj - when making group/object names only use both object and mesh name when they differ.
weightpaint_clean, weightpaint_grow_shrink - minor updates.
Render.py - own error in epydocs.
- Dont allow it to apply the matrix twice to a linked-dupe. (Same as Apply Loc/Size/Rot)
- Make sure that the source object is active, not just the first selected object.
- Use Mesh instead of NMesh.
- use mesh.transform(mat) rather then vert by vert vec*mat
Other scripts had pupBlock changes for better layout.
Minor changes to radiosity_export, updated to work with the new API (vertexColors MTFace)
obdatacopier - was getting the selection but not using it. made it ignore some read only properties.
BPyMesh - minor change: use face iterator rather then making a tuple()
import_obj - comments, docstring additions, cleanup.
OBJ export: -renamed export_obj
faster edge exporting (use edges LOOSE flag rather then finding zero face user edges)
check for file before overwriting
use object iterators