[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 05:39:08 CEST 2010


 

On October 11, 2010 at 2:57 AM Alberto Torres <kungfoobar at gmail.com> wrote:

> Hi,
>
> The .001, .002, etc prefix is added automatically whenever there is an
> object with the same name. To refer to the new object, do this:
> 
OK, but that just restates what I already wrote and doesn't address my
questions.  Yes, these suffixes are auto-generated. (I, too, initially called
them "prefixes" when I started writing my previous post -- it's a strange
tendency to say the latter in stead of the former :-))
 

> new_object = current_scene.objects.new(mesh_name, 'mynewobjectname')
> new_object.setLocation(....)
> 
and the above also works for me, as I said in the original post, and is not part
of the issue.
 
The issue is referring to the object AFTER it's created (via the above command),
by name.
 
Using  'mynewobjectname' with Blender.Object.Get(...) is what fails.
 
You have to include the suffix (it appears):
Blender.Object.Get('mynewobjectname.001'), in order to get the right reference.
 
My question was -- is that necessarily so, in all cases of object creation?  And
how can I ask python what the particular suffix is? I don't want to have to
"guess", algorithmically.
 
 

> Regards
>
> --
> Alberto Torres
>
>
>
> On Mon, Oct 11, 2010 at 3:11 AM, andrew2006 at flight.us
> <andrew2006 at flight.us> wrote:
> > current_scene.objects.new(mesh_name, 'mynewobjectname')
> _______________________________________________
> 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/20101010/7b3dcada/attachment.html>


More information about the Bf-python mailing list