[Bf-python] obj.setLocation(x, y, z) and obj.LocX=x don't seem to work

andrew2006 at flight.us andrew2006 at flight.us
Mon Oct 11 10:37:26 CEST 2010


 

On October 11, 2010 at 6:08 AM Stephen Swaney <sswaney at centurytel.net> wrote:

> On Mon, Oct 11, 2010 at 01:15:22AM -0400, andrew2006 at flight.us wrote:
> >
> >  
> >
> > On October 11, 2010 at 4:22 AM Stephen Swaney <sswaney at centurytel.net>
> > wrote:
> >  
> > > To refer to an object by name, you have to use its actual name.
> >  
> > No! that has been my point all along. Using the original (actual?) name does
> > not
> > work for me (see original post), but using the name plus the ".001" does.
> > Like
> > so:
> >  
> >                Blender.Object.Get('name_i_originally_gave.001')
>
> Uh, yes!  To refer to an object by name, you must use the actual object name.
> You are over-thinking this.  I am not sure how to make this any clearer than
> repeating what we have already said.  Go read what Alberto wrote and think
> about
> the implications.
 
with the following code, my new mesh object remains at the origin, in spite of
the setLocation line:
 
myscene.objects.new(me,'cylmesh')
meshobj=Blender.Object.Get('cylmesh')
meshobj.setLocation(newx, newy, newz)
 
but with the following code, the new mesh object does get relocated to (newx,
newy, newz):
 
myscene.objects.new(me,'cylmesh')
meshobj=Blender.Object.Get('cylmesh.001')
meshobj.setLocation(newx, newy, newz)
 
the difference is the ".001" suffix
 
Thus, I don't understand what you guys mean when you say I should "use the
actual object name".
 
What IS the actual object name? What works for me is the
"Blender.Object.Get('cylmesh.001')" reference, not the
Blender.Object.Get('cylmesh'). Is 'cylmesh' the actual name, because I used it
when calling myscene.objects.new(...)?  Or "cylmesh.001" is the actual name??
 
a.




> > S.
> --
> Stephen Swaney                       
> sswaney at centurytel.net
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20101011/5cd0f31d/attachment.html>


More information about the Bf-python mailing list