Results 1 to 2 of 2
  1. #1

    Script running only on Active object, not entire selection?

    I am trying to make a script to Clear Custom Split Normals on all the objects I have selected. I have copied code from other scripts that run a command on all selected objects. However, this only seems to work on the Active Object, not the rest of the selection. Anyone know why?
    import bpy
    selected_objects = bpy.context.selected_objects
    for selected_object in selected_objects:
    Non-Photorealistic Rendering and basic character tutorials:

  2. #2
    Join Date
    Sep 2015
    bpy.ops.blahblah does not necessarily share all its characteristic with a different bpy.ops.brahbrah

    Every bpy.ops.blah works differently. Most of them only work on the active object. Some of them work on multiple objects.

    If you want such "active-only" operator to work on multiple objects, you need to set scene's active object target to the object in your selections for that specific loop.

    for obj in selected_objects: = obj
    Basically, for each loop, you change the active object in the scene, and then execute the bpy.ops.whatever.

    Typical Macro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts