can´t make uv and return attributes in the same execution #25854

Closed
opened 2011-01-29 19:27:32 +01:00 by Vitor Balbio · 4 comments

%%%This is a problem that i have with uv in python
As i sad in title we can´t make a new uv (MeshTextureFaceLayer) and return yours attributes in the same execution.

Trying this:

import bpy
obj = bpy.context.active_object
mesh = obj.data
uvtex = bpy.ops.mesh.uv_texture_add()
print(dir(uvtex))

we get the list:

['and', 'class', 'contains', 'delattr', 'doc', 'eq', '__
format__', 'ge', 'getattribute', 'gt', 'hash', 'iand', 'in
it
', 'ior', 'isub', 'iter', 'ixor', 'le', 'len', '__lt
__', 'ne', 'new', 'or', 'rand', 'reduce', 'reduce_ex', '
repr', 'ror', 'rsub', 'rxor', 'setattr', 'sizeof', 'st
r
', 'sub', 'subclasshook', 'xor', 'add', 'clear', 'copy', 'differe
nce', 'difference_update', 'discard', 'intersection', 'intersection_update', 'is
disjoint', 'issubset', 'issuperset', 'pop', 'remove', 'symmetric_difference', 's
ymmetric_difference_update', 'union', 'update']

but with the uv created and trying this:

import bpy
obj = bpy.context.active_object
mesh = obj.data
uvtex = mesh.uv_textures.active
print(dir(uvtex))

we get this:

['doc', 'module', 'slots', 'active', 'active_clone', 'active_render'
, 'bl_rna', 'data', 'name', 'rna_type']

As would be...

This bug is crashing the script template "uv Operator" of Trunk
Any idea?

Bye!%%%

%%%This is a problem that i have with uv in python As i sad in title we can´t make a new uv (MeshTextureFaceLayer) and return yours attributes in the same execution. Trying this: import bpy obj = bpy.context.active_object mesh = obj.data uvtex = bpy.ops.mesh.uv_texture_add() print(dir(uvtex)) we get the list: ['__and__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__ format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__iand__', '__in it__', '__ior__', '__isub__', '__iter__', '__ixor__', '__le__', '__len__', '__lt __', '__ne__', '__new__', '__or__', '__rand__', '__reduce__', '__reduce_ex__', ' __repr__', '__ror__', '__rsub__', '__rxor__', '__setattr__', '__sizeof__', '__st r__', '__sub__', '__subclasshook__', '__xor__', 'add', 'clear', 'copy', 'differe nce', 'difference_update', 'discard', 'intersection', 'intersection_update', 'is disjoint', 'issubset', 'issuperset', 'pop', 'remove', 'symmetric_difference', 's ymmetric_difference_update', 'union', 'update'] but with the uv created and trying this: import bpy obj = bpy.context.active_object mesh = obj.data uvtex = mesh.uv_textures.active print(dir(uvtex)) we get this: ['__doc__', '__module__', '__slots__', 'active', 'active_clone', 'active_render' , 'bl_rna', 'data', 'name', 'rna_type'] As would be... This bug is crashing the script template "uv Operator" of Trunk Any idea? Bye!%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%More stuff for campbell :)%%%

%%%More stuff for campbell :)%%%

%%%Operators never return data like this, we have rna functions which work as you are expecting.
most collections have load/new/add functions as well as equivalents for removing.

---

import bpy
obj = bpy.context.active_object
uvlayer = obj.data.uv_textures.new()%%%

%%%Operators never return data like this, we have rna functions which work as you are expecting. most collections have load/new/add functions as well as equivalents for removing. # --- import bpy obj = bpy.context.active_object uvlayer = obj.data.uv_textures.new()%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#25854
No description provided.