mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #152992: Torus added in edit mode does not reuse existing materials on objects
Adding a torus to an object in edit mode does not reuse the existing materials of the object but instead adds an empty material slot for the torus. This is not consistent behavior with adding other primitives. Resolve by copying the active object's active material into the material slot of the torus. Pull Request: https://projects.blender.org/blender/blender/pulls/153099
This commit is contained in:
parent
44cabb12ee
commit
943be0a28d
1 changed files with 4 additions and 0 deletions
|
|
@ -139,6 +139,10 @@ def object_data_add(context, obdata, operator=None, name=None):
|
|||
if uv_act is not None:
|
||||
uv_new.name = uv_act.name
|
||||
|
||||
# Copy the active object's active material into the primitive with no materials.
|
||||
if len(obj_act.data.materials) > 0 and len(obdata.materials) == 0:
|
||||
obdata.materials.append(obj_act.active_material)
|
||||
|
||||
bpy.ops.object.join() # join into the active.
|
||||
if obdata:
|
||||
bpy.data.meshes.remove(obdata)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue