Oh ok. So orientation is an optional parameter. That makes sense. Alright well thanks for the help<br><br>And yeah next time it would probably be better to try the blender forums. thanks though<br><br><div class="gmail_quote">
On Thu, Jul 22, 2010 at 3:06 AM, David Hutto <span dir="ltr">&lt;<a href="mailto:smokefloat@gmail.com">smokefloat@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Thu, Jul 22, 2010 at 2:47 AM, Marc Tompkins &lt;<a href="mailto:marc.tompkins@gmail.com">marc.tompkins@gmail.com</a>&gt; wrote:<br>
&gt; On Wed, Jul 21, 2010 at 9:48 PM, Andrew Martin &lt;<a href="mailto:amartin7211@gmail.com">amartin7211@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; This code was part of a Blender script to build a 3d bar graph, so I don&#39;t<br>
&gt;&gt; know if understanding Blender is a prereq for understanding this code. The<br>
&gt;&gt; function is for the axis labels.<br>
&gt;&gt;<br>
&gt;&gt; def label(text,position,orientation=&#39;z&#39;):<br>
&gt;&gt;     txt=Text3d.New(&#39;label&#39;)<br>
&gt;&gt;     txt.setText(text)<br>
&gt;&gt;     ob=Scene.GetCurrent().objects.new(txt)<br>
&gt;&gt;     ob.setLocation(*position)<br>
&gt;&gt;     if orientation==&#39;x&#39;:<br>
&gt;&gt;         ob.setEuler(-pi/2.0,0,0)<br>
&gt;&gt;     elif orientation==&#39;z&#39;:<br>
&gt;&gt;         ob.setEuler(0,0,pi/2.0)<br>
&gt;&gt;     print &#39;label %s at %s along %s&#39; %(text,position,orientation)<br>
&gt;&gt;<br>
&gt;&gt;  I understand it for the most part except for the orientation part. I<br>
&gt;&gt; assume orientation is for the 3d text object, but how is it determined<br>
&gt;&gt; whether it is x or z?<br>
&gt;<br>
&gt; I don&#39;t use Blender myself, so this will be a more generic, high-level<br>
&gt; answer...<br>
&gt;&gt;<br>
&gt;&gt; def label(text,position,orientation=&#39;z&#39;):<br>
&gt;<br>
&gt; This definition specifies that label() takes two mandatory parameters - text<br>
&gt; and position - and one optional parameter, orientation.  What makes<br>
&gt; &quot;orientation&quot; optional is the fact that a default value is supplied:<br>
&gt; &quot;orientation=&#39;z&#39;&quot;.  In other words, &quot;orientation&quot; is equal to &quot;z&quot; unless you<br>
&gt; specify otherwise in your call to label().<br>
<br>
</div></div>Seeing as how blender is 3d graphics, have you tried the &#39;newbie<br>
fidget with it&#39;, and typed in w(quaternion),x, or y to see what<br>
occurs. Also, have you looked into the hierarchy to see if z, which<br>
looks as though it&#39;s contained in a string, is an input variable<br>
declared elsewhere as an integer, or represents something else in it&#39;s<br>
usage. Z can mean global, or object orientation in blender from what I<br>
see.<br>
<div class="im"><br>
&gt;<br>
&gt; Take a look at this section of the Python docs:<br>
&gt; <a href="http://docs.python.org/tutorial/controlflow.html#more-on-defining-functions" target="_blank">http://docs.python.org/tutorial/controlflow.html#more-on-defining-functions</a><br>
&gt;<br>
&gt; Hope that helps...<br>
&gt;<br>
&gt;<br>
</div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
&gt; To unsubscribe or change subscription options:<br>
&gt; <a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML"></div>