[Bf-python] 3 quick questions

David Silverman silvermindyarr at gmail.com
Wed May 18 18:47:01 CEST 2011


It seems that the active object is set by your example, but it is not
"selected". Is there a way that can do both?(selecting = set active object?)

On Wed, May 18, 2011 at 7:50 AM, Bassam Kurdali <bkurdali at freefac.org>wrote:

> On Tue, 2011-05-17 at 23:22 -0700, David Silverman wrote:
> > *It seems that the active object is read only. Is there a way to
> > select an object by name?
> context is read only, but you can both change the active object and
> select by name:
> change active:
> bpy.context.scene.objects.active = bpy.data.objects["Cube"]
> by name:
> myobj = bpy.data.objects["Cube"]
> >
> > *What is the difference between:
> >     bpy.ops.group.create(name= group_name)
> > and
> >     group = bpy.data.groups.new(group_name)
> > (only the data one works...)
> The first is an operator, i.e. a tool for users; it works on context
> (you can create your own from inheriting from the operator class).
> Context includes selection, which mode/space you are in, etc.
> The operator works for me too, don't know the problem there.
> >
> > *I have trouble exploring everything in the API using the console. Is
> > there a good resource to browse that has all that help info with each
> > item?
> Yes:
> 1- console: command completion , python introspection
> 2- Help->Python API Reference
> 3- Tooltips
> 4- right click on buttons -> copy data path
> 5- pull down the info window and wach/copy the operators that are echoed
> there when you use the ui
> 6- Help-> Operator Cheat sheet
> 7- Text Editor, Text->Script Templates (lots of useful examples to start
> from)
> I may have missed some... maybe the #blenderpython irc channel on
> freenode.
> >
> >
> > Thanks in advance!
> > David
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-python
>
>
> _______________________________________________
> 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/20110518/0379b146/attachment.html>


More information about the Bf-python mailing list