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"><<a href="mailto:smokefloat@gmail.com">smokefloat@gmail.com</a>></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 <<a href="mailto:marc.tompkins@gmail.com">marc.tompkins@gmail.com</a>> wrote:<br>
> On Wed, Jul 21, 2010 at 9:48 PM, Andrew Martin <<a href="mailto:amartin7211@gmail.com">amartin7211@gmail.com</a>><br>
> wrote:<br>
>><br>
>> This code was part of a Blender script to build a 3d bar graph, so I don't<br>
>> know if understanding Blender is a prereq for understanding this code. The<br>
>> function is for the axis labels.<br>
>><br>
>> def label(text,position,orientation='z'):<br>
>> txt=Text3d.New('label')<br>
>> txt.setText(text)<br>
>> ob=Scene.GetCurrent().objects.new(txt)<br>
>> ob.setLocation(*position)<br>
>> if orientation=='x':<br>
>> ob.setEuler(-pi/2.0,0,0)<br>
>> elif orientation=='z':<br>
>> ob.setEuler(0,0,pi/2.0)<br>
>> print 'label %s at %s along %s' %(text,position,orientation)<br>
>><br>
>> I understand it for the most part except for the orientation part. I<br>
>> assume orientation is for the 3d text object, but how is it determined<br>
>> whether it is x or z?<br>
><br>
> I don't use Blender myself, so this will be a more generic, high-level<br>
> answer...<br>
>><br>
>> def label(text,position,orientation='z'):<br>
><br>
> This definition specifies that label() takes two mandatory parameters - text<br>
> and position - and one optional parameter, orientation. What makes<br>
> "orientation" optional is the fact that a default value is supplied:<br>
> "orientation='z'". In other words, "orientation" is equal to "z" unless you<br>
> specify otherwise in your call to label().<br>
<br>
</div></div>Seeing as how blender is 3d graphics, have you tried the 'newbie<br>
fidget with it', 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's contained in a string, is an input variable<br>
declared elsewhere as an integer, or represents something else in it's<br>
usage. Z can mean global, or object orientation in blender from what I<br>
see.<br>
<div class="im"><br>
><br>
> Take a look at this section of the Python docs:<br>
> <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>
><br>
> Hope that helps...<br>
><br>
><br>
</div><div><div></div><div class="h5">> _______________________________________________<br>
> Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
> To unsubscribe or change subscription options:<br>
> <a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
><br>
><br>
</div></div></blockquote></div><br><input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML"></div>