[Bf-python] Fwd: Re: 'obj.data' returns NMesh data object even when made with Mesh class.

Campbell Barton cbarton at metavr.com
Tue Aug 7 14:49:18 CEST 2007


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.

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



More information about the Bf-python mailing list