[Bf-python] Fwd: Re: 'obj.data' returns NMesh data object even when made with Mesh class.
Dietrich Bollmann
diresu at web.de
Wed Aug 8 10:51:37 CEST 2007
On Tue, 2007-08-07 at 22:49 +1000, Campbell Barton wrote:
> Toni Alatalo wrote:
> >> Maybe an error message when trying to do something like
> >>>>> object.data.materials = [ material ]
> >> would be helpful.
> >
> > hm .. i wonder if it would make sense for NMesh to handle some errors so that
> > it suggests 'i am depracated, did you mean to use Mesh instead?. dunno if
> > some hints could be easily hacked there somewhere.
>
> object.data.materials = [ material ]
>
> Theres no way to detect that the NMesh is being created, altered, then
> deallocated (with no change to blenders data)
>
> We cant fix in the current API but in the develoment python API NMesh
> has been removed and this works.
Ok - I am happy with the current method and just wrote my message
to help making the API easier to use for the next person with a similar
problem. But if there is no NMesh in the new version the problem
vanishes soon anyway.
Even if not helpful I learnt something by reading the answers -
thank you :)
Is everything in the current API already working in the new
development API? Would it be wiser to continue working with the
latter one?
> Iv also subtyped lists, so the lists synchronize with blender's data
>
> ls = object.data.materials
> ls.append(mat)
>
> - works also.
>
> http://wiki.blender.org/index.php/Rewriting_the_2.4x_BPython_API
That looks very promising :)
How about also implementing a widgets library so that Blender
could be used not only as the GUI based 3D/animation editing tool
it is now but also as a 3D/animation python extension with GUI
and everything :) But I think I read this already somewhere
in a document about Blenders future?
Another thing I would like to have is a method to dump
Objects / datablocks into some textual form which could be
saved in files or a data bank or used to send objects over
a socket. But probably something like this exist already
and I just don't know about it?
Sorry for those two last paragraphs which are completely
not connected to the topic of this message :)
Greetings, Dietrich
More information about the Bf-python
mailing list