[Bf-python] mesh.object
Martin Poirier
theeth at yahoo.com
Thu Feb 23 12:54:41 CET 2006
--- Campbell Barton <cbarton at metavr.com> wrote:
> Martin Poirier wrote:
> > --- Campbell Barton <cbarton at metavr.com> wrote:
> >
> >
> >> Would it be possible to have an object property
> of
> >> mesh?
> >> Since some functions require a mesh be referenced
> to
> >> an object it may be
> >> good.
> >>
> >> say mesh.getInfluences(0) failes if the mesh is
> not
> >> retrived from an
> >> object, but there is no way to check this.
> >> if we have mesh.object - None for new meshes and
> >> meshes retrieved by
> >> Mesh.Get('foobar') mesh.object == None.
> >> for
> >> me= ob.getData(mesh=1)
> >> ob == me.object
> >>
> >> Any complaints?
> >>
> >
> > Err, multi user meshes.
> >
> > Martin
> >
> This isn't meant to show what object uses a mesh.
> Rather the object that
> is used by the mesh for getting bone influences.
> Eg. Say a function uses. a mesh and needs vert
> influences. the only way
> to check now is to try/except me.getInfluences(0) .
> Better say,
> if mesh.object:
> infs= mesh.getInfluences(i)
I'd reject that proposition base on two reasons.
1- This is just a quirky hack (based on a an
artificial state of a bpy wrapper) to sooth an API
design flaw.
2- You're basicly asking for a "permission" check,
which go against the "better to ask forgiveness than
permission" python philosophy.
Martin
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Bf-python
mailing list