On Dec 19, 2007 6:46 AM, Mark Ivey &lt;<a href="mailto:zovirl1@sbcglobal.net">zovirl1@sbcglobal.net</a>&gt; 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. &nbsp;If the<br>vertices are all integer values, it crashes with this error message:<br><br>importing obj &quot;/Users/mivey/crash.obj&quot;<br> &nbsp; &nbsp; &nbsp; &nbsp;passing obj file &quot;/Users/mivey/crash.obj&quot;...
<br>Traceback (most recent call last):<br> &nbsp; File &quot;&lt;string&gt;&quot;, line 831, in load_obj_ui<br> &nbsp; File &quot;&lt;string&gt;&quot;, line 594, in load_obj<br>TypeError: &#39;NoneType&#39; 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. &nbsp;I couldn&#39;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&#39;ll include it here:<br><br>Index: release/scripts/import_obj.py<br>===================================================================
<br>--- release/scripts/import_obj.py &nbsp; &nbsp; &nbsp; (revision 12940)<br>+++ release/scripts/import_obj.py &nbsp; &nbsp; &nbsp; (working copy)<br>@@ -542,6 +542,7 @@<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return lambda f: float(f.replace<br>(&#39;,&#39;, &#39;.&#39;))
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elif &#39;.&#39; in line:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return float<br>+ &nbsp; &nbsp; &nbsp; return float # Maybe file only contained integers? &nbsp;float is<br>a good default.<br><br> &nbsp;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> &nbsp; &nbsp; &nbsp; &nbsp; &#39;&#39;&#39;<br><br>Here&#39;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&nbsp;</div></div>