Entry AREA_PLANE is not a valid property for map_mode in class bpy.types.BrushTextureSlot(TextureSlot) #86986

Closed
opened 2021-03-27 23:38:12 +01:00 by Naoki · 7 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.09

Blender Version
Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-26 21:30, hash: blender/blender@9b87d3f029
Worked: Same happens at least as far as 2.91.0. Tested on 2.92.0 as well, same result.

Short description of error
Entry AREA_PLANE is not a valid property for map_mode in class bpy.types.BrushTextureSlot(TextureSlot)

Exact steps for others to reproduce the error

  • Create a new Blender file;
  • Go to the Scripting tab or open the Python console
  • Type the following: bpy.data.brushes- [x].texture_slot.map_mode = 'AREA_PLANE'
  • Error is TypeError: bpy_struct: item.attr = val: enum "AREA_PLANE" not found in ('VIEW_PLANE', 'TILED', '3D', 'RANDOM', 'STENCIL'), even though the documentation states that map_mode should be enum in [‘VIEW_PLANE’, ‘AREA_PLANE’, ‘TILED’, ‘3D’, ‘RANDOM’, ‘STENCIL’], default ‘TILED’
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.09 **Blender Version** Broken: version: 2.93.0 Alpha, branch: master, commit date: 2021-03-26 21:30, hash: `blender/blender@9b87d3f029` Worked: Same happens at least as far as 2.91.0. Tested on 2.92.0 as well, same result. **Short description of error** Entry `AREA_PLANE` is not a valid property for `map_mode` in class `bpy.types.BrushTextureSlot(TextureSlot)` **Exact steps for others to reproduce the error** - Create a new Blender file; - Go to the Scripting tab or open the Python console - Type the following: `bpy.data.brushes- [x].texture_slot.map_mode = 'AREA_PLANE'` - Error is `TypeError: bpy_struct: item.attr = val: enum "AREA_PLANE" not found in ('VIEW_PLANE', 'TILED', '3D', 'RANDOM', 'STENCIL')`, even though [the documentation states](https://docs.blender.org/api/current/bpy.types.BrushTextureSlot.html#bpy.types.BrushTextureSlot.map_mode) that map_mode should be `enum in [‘VIEW_PLANE’, ‘AREA_PLANE’, ‘TILED’, ‘3D’, ‘RANDOM’, ‘STENCIL’], default ‘TILED’`
Author

Added subscriber: @Naoki

Added subscriber: @Naoki
Member

Added subscriber: @filedescriptor

Added subscriber: @filedescriptor
Member

It seems as though the problem is that the EnumProperty map_mode uses rna_enum_brush_texture_slot_map_all_mode_items which is defined as:

static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[] = {
    {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
    {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""},
    {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
    {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
    {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
    {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
    {0, NULL, 0, NULL, NULL},
};

but if the active paintmode is not PAINT_MODE_SCULPT then it uses rna_enum_brush_texture_slot_map_texture_mode_items which is defined as:

static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = {
    {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""},
    {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""},
    {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""},
    {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""},
    {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""},
    {0, NULL, 0, NULL, NULL},
};

(notice AREA_PLANE is not defined). So my take from this is that it is most likely not a bug, but not documented correctly (probably due to the documentation being mostly auto-generated).

It seems as though the problem is that the `EnumProperty` `map_mode` uses `rna_enum_brush_texture_slot_map_all_mode_items` which is defined as: ``` static const EnumPropertyItem rna_enum_brush_texture_slot_map_all_mode_items[] = { {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""}, {MTEX_MAP_MODE_AREA, "AREA_PLANE", 0, "Area Plane", ""}, {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""}, {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""}, {0, NULL, 0, NULL, NULL}, }; ``` but if the active paintmode is **not** `PAINT_MODE_SCULPT` then it uses `rna_enum_brush_texture_slot_map_texture_mode_items` which is defined as: ``` static const EnumPropertyItem rna_enum_brush_texture_slot_map_texture_mode_items[] = { {MTEX_MAP_MODE_VIEW, "VIEW_PLANE", 0, "View Plane", ""}, {MTEX_MAP_MODE_TILED, "TILED", 0, "Tiled", ""}, {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, {MTEX_MAP_MODE_RANDOM, "RANDOM", 0, "Random", ""}, {MTEX_MAP_MODE_STENCIL, "STENCIL", 0, "Stencil", ""}, {0, NULL, 0, NULL, NULL}, }; ``` (notice `AREA_PLANE` is not defined). So my take from this is that it is most likely not a bug, but not documented correctly (probably due to the documentation being mostly auto-generated).
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'

Closing, since there are many enum's that have values that change depending on other settings.

The documentation to address this would likely need to be general since this happens in many places.

Closing, since there are many enum's that have values that change depending on other settings. The documentation to address this would likely need to be general since this happens in many places.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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-manual#86986
No description provided.