Page MenuHome

Multi-object scale to bounds calculations for UV_OT_project_from_view
ClosedPublic

Authored by Alan Troth (Al) on May 14 2018, 1:25 AM.

Details

Summary

Multi-object scale to bounds calculations for UV_OT_project_from_view. Task from T54645.

Diff Detail

Repository
rB Blender

Event Timeline

Alan Troth (Al) retitled this revision from Scale to bounds calculations for UV_OT_project_from. to Multi-object scale to bounds calculations for UV_OT_project_from_view.May 14 2018, 1:42 AM
Alan Troth (Al) edited the summary of this revision. (Show Details)

This is a good start, there are a few things we can simplify.

source/blender/editors/uvedit/uvedit_unwrap_ops.c
1291

There is no need to duplicate the entire function, uv_map_clip_correct can call uv_map_clip_correct_multi with an array of 1 item.

1553–1554

No need to allocate a separate array, you can remove items in the array along the way:

		if (changed) {
			changed_multi = true;
			DEG_id_tag_update(obedit->data, 0);
			WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
		}
		else {
			ARRAY_DELETE_REORDER_LAST(objects, ob_index, 1, objects_len);
			objects_len -= 1;
			ob_index -= 1;
		}
1632–1633

Tagging can be done in the loop above, no need for it to be a separate loop after everything else.

Noticed the orthographic option isn't working so I've left this operator marked as uncompleted.

However this isn't closely related to the changes in this patch, so committed with suggested edits.

See: rB379c3e46d58bc3b9e92c09b4686ac28ab4f34804

This revision is now accepted and ready to land.May 14 2018, 9:26 AM