Post #3001: Hi Roaoa,

๐Ÿ“‹ Metadata

  • Author: panosz
  • Date: 2020-01-31 18:38:05
  • Type: question
  • Quality Score: 7/10
  • Replies (1): post_03002

๐Ÿท๏ธ Tags

macro python-scripting intermediate unsolved

  • Macro Editor
  • Python Scripting

๐Ÿ’ฌ Content

Hi Roaoa,
I want to use an Array modifier with specific settings as a default in a pie. I copied the code from info and all works ok until I add a second Array modifier. The code adds a second array e.g. Array.001, but since the name โ€œArrayโ€ was given at the first modifier it changes all my settings to my defaults and the second modifier is added with the programs defaults.
the code Iโ€™m using was copied from info

bpy.ops.object.modifier_add(type='ARRAY'); bpy.context.object.modifiers["Array"].use_relative_offset = False; bpy.context.object.modifiers["Array"].count = 1

Is there a way to recognize the new modifierโ€™s name and leave the old one as is?


๐Ÿ”— View on Blender Artists