Page MenuHome

Exclude 'Render Result' and 'Viewer' images where not supported T73182
Needs RevisionPublic

Authored by Manuel Castilla (manzanilla) on May 6 2021, 9:49 AM.

Details

Summary

Using Render Result and Viewer image types is not currently supported on certain contexts when rendering/compositing. This is due to image data not being available yet or running into recursion.

This patch excludes them in the following image dropdowns where issues are already known/reported or it may not make sense to display them (see T73182):

  • Shader editor: Image texture and environment texture nodes.
  • Texture nodes editor: Image node.
  • Texture properties: In image settings for image textures.
  • Compositor: Image node.
  • UV editor: Image selector.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D11179 (branched from master)
Build Status
Buildable 17923
Build 17923: arc lint + arc unit

Event Timeline

Manuel Castilla (manzanilla) requested review of this revision.May 6 2021, 9:49 AM
Manuel Castilla (manzanilla) created this revision.
  • Exclude in texture properties too
Jeroen Bakker (jbakker) requested changes to this revision.May 10 2021, 9:01 AM

I would add versioning code so old files are fixed. Otherwise data contain something illegal. Future development/optimizations might build on this change and potentially crash on older files.

source/blender/makesrna/intern/rna_space.c
1606

Better to get the instance to the Space from ptr->data and use plain checks.

This revision now requires changes to proceed.May 10 2021, 9:01 AM

Just noticed you can also pick these while texture painting (e.g. canvas):

Patch for this is in D12609

  • Merge branch 'master' into arcpatch-D11179
  • Do plain checks using ptr->data
  • Unselect viewer images when switching to UV Editor
  • Add versioning code
Jeroen Bakker (jbakker) requested changes to this revision.Oct 27 2021, 8:07 AM

Sorry for the late reply. Last month was too occupied with asset browser and I neglected module work.

source/blender/editors/space_image/space_image.c
358

This code doesn't seem to fit with the surrounding code. When is this case still happening?

source/blender/makesrna/intern/rna_nodetree.c
3848

Looking at other areas rna_Action_id_poll is used. Consider using image_id_poll in the name. Makes it more clear that this is not about the image nodes.

source/blender/makesrna/intern/rna_space.c
1604

consider using image_id_poll in the name.

source/blender/makesrna/intern/rna_texture.c
463

Same here.

This revision now requires changes to proceed.Oct 27 2021, 8:07 AM
  • Merge branch 'master' into arcpatch-D11179
  • Rename *_image_poll functions to *_image_id_poll
Manuel Castilla (manzanilla) marked 5 inline comments as done.Oct 29 2021, 2:25 AM
Manuel Castilla (manzanilla) added inline comments.
source/blender/editors/space_image/space_image.c
358

When you have selected a viewer image in Image Editor and switch to UV Editor, it deselects the image so that user don't use it in UV.
Only way I've found is to check for every space notification.

Seems fine, just missed something during the previous review.

source/blender/editors/space_image/space_image.c
358

Yes I see.

Perhaps add a comment about this. I couldn't find another solution that fitted better.

source/blender/makesrna/intern/rna_space.c
1609

Use !ELEM( macro

source/blender/makesrna/intern/rna_texture.c
466

Use !ELEM( macro.

Jeroen Bakker (jbakker) requested changes to this revision.Oct 29 2021, 8:56 AM
This revision now requires changes to proceed.Oct 29 2021, 8:56 AM