Fix T80597: Assigning material slot from Python console fails
Regression in 12bc34b0b8, add assert so this doesn't happen again.
This commit is contained in:
@@ -1710,6 +1710,9 @@ void BKE_view_layer_bases_in_mode_iterator_begin(BLI_Iterator *iter, void *data_
|
||||
struct ObjectsInModeIteratorData *data = data_in;
|
||||
Base *base = data->base_active;
|
||||
|
||||
/* In this case the result will always be empty, the caller must check for no mode. */
|
||||
BLI_assert(data->object_mode != 0);
|
||||
|
||||
/* when there are no objects */
|
||||
if (base == NULL) {
|
||||
iter->valid = false;
|
||||
|
||||
@@ -194,11 +194,13 @@ Object **ED_object_array_in_mode_or_selected(bContext *C,
|
||||
/* When in a mode that supports multiple active objects, use "objects in mode"
|
||||
* instead of the object's selection. */
|
||||
if ((ob_active != NULL) && (ob_active->mode & (OB_MODE_EDIT | OB_MODE_POSE))) {
|
||||
objects = BKE_view_layer_array_from_objects_in_mode(
|
||||
view_layer,
|
||||
v3d,
|
||||
r_objects_len,
|
||||
{.no_dup_data = true, .filter_fn = filter_fn, .filter_userdata = filter_user_data});
|
||||
objects = BKE_view_layer_array_from_objects_in_mode(view_layer,
|
||||
v3d,
|
||||
r_objects_len,
|
||||
{.object_mode = ob_active->mode,
|
||||
.no_dup_data = true,
|
||||
.filter_fn = filter_fn,
|
||||
.filter_userdata = filter_user_data});
|
||||
}
|
||||
else {
|
||||
objects = BKE_view_layer_array_selected_objects(
|
||||
|
||||
Reference in New Issue
Block a user