inconsistency when setting active uv_texture #31395

Closed
opened 2012-05-10 16:37:11 +02:00 by Ola Sikström · 5 comments

%%%Assuming we want to activate the uv-set named 'bake', and then bake the textures using bpy.ops.object.bake_image()
The active object should have at least two uv_textures, and the one named 'bake' (having an image assigned) should not be active.

The following works:
bpy.context.active_object.data.uv_textures.active = bpy.context.active_object.data.uv_textures['bake']

while this does not:
bpy.context.active_object.data.uv_textures['bake'].active = True

The attached blend-file should be clear enough. Run either of the scripts without doing anything else. Be sure to reopen the file before running the other.

I expect that they should be equivalent, but on the second variant blender complains that there are no valid images to bake to, even when there are.
Tested on the official build for 2.63a, windows64, as well as a couple of previous releases.%%%

%%%Assuming we want to activate the uv-set named 'bake', and then bake the textures using bpy.ops.object.bake_image() The active object should have at least two uv_textures, and the one named 'bake' (having an image assigned) should not be active. The following works: bpy.context.active_object.data.uv_textures.active = bpy.context.active_object.data.uv_textures['bake'] while this does not: bpy.context.active_object.data.uv_textures['bake'].active = True The attached blend-file should be clear enough. Run either of the scripts without doing anything else. Be sure to reopen the file before running the other. I expect that they should be equivalent, but on the second variant blender complains that there are no valid images to bake to, even when there are. Tested on the official build for 2.63a, windows64, as well as a couple of previous releases.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%I forgot to mention:

The line seems to work by itself, but it does not work in combination with to_mesh(), like demonstrated in the blend-file, so don't know what exactly causes the problem%%%

%%%I forgot to mention: The line seems to work by itself, but it does not work in combination with to_mesh(), like demonstrated in the blend-file, so don't know what exactly causes the problem%%%
Author

%%%I just noticed that if i do mesh.update() right before baking, it works on both versions...
So this might not be a bug after all. I still think it's confusing that the behaviour is different though :)%%%

%%%I just noticed that if i do mesh.update() right before baking, it works on both versions... So this might not be a bug after all. I still think it's confusing that the behaviour is different though :)%%%

%%%They both should both work, was just a missing update for the second case. Fixed in svn, thanks for the report.%%%

%%%They both should both work, was just a missing update for the second case. Fixed in svn, thanks for the report.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#31395
No description provided.