On Dec 19, 2007 6:46 AM, Mark Ivey <<a href="mailto:zovirl1@sbcglobal.net">zovirl1@sbcglobal.net</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Greetings,<br><br>I ran into a simple problem with the wavefront .obj importer. If the<br>vertices are all integer values, it crashes with this error message:<br><br>importing obj "/Users/mivey/crash.obj"<br> passing obj file "/Users/mivey/crash.obj"...
<br>Traceback (most recent call last):<br> File "<string>", line 831, in load_obj_ui<br> File "<string>", line 594, in load_obj<br>TypeError: 'NoneType' object is not callable<br>
<br>The culprit is that get_float_func() can fall off the end of the<br>function, implicitly returning None instead of a function reference.<br>The fix is simple: make sure get_float_func returns float by<br>default. I couldn't figure out how to add a patch to the tracker on
<br><a href="http://projects.blender.org" target="_blank">projects.blender.org</a>, but it is really simple so I'll include it here:<br><br>Index: release/scripts/import_obj.py<br>===================================================================
<br>--- release/scripts/import_obj.py (revision 12940)<br>+++ release/scripts/import_obj.py (working copy)<br>@@ -542,6 +542,7 @@<br> return lambda f: float(f.replace<br>(',', '.'))
<br> elif '.' in line:<br> return float<br>+ return float # Maybe file only contained integers? float is<br>a good default.<br><br> def load_obj(filepath, CLAMP_SIZE=
0.0, CREATE_FGONS= True,<br>CREATE_SMOOTH_GROUPS= True, CREATE_EDGES= True, SPLIT_OBJECTS= True,<br>SPLIT_GROUPS= True, SPLIT_MATERIALS= True, IMAGE_SEARCH=True):<br> '''<br><br>Here's a simple .obj file that exposes the problem:
<br>v 0 0 0<br>v 0 0 1<br>v 1 0 1<br>v 1 0 0<br>f 1 2 3 4</blockquote><div><br>Good for picking up this one, commited the fix </div></div>