1

I'm creating a simple script where once executed it adds a mirror modifier to an object. The next step would be to invoke this button through the script and then I click on the object I want to mirror my selected object around:

enter image description here

But the command doesn't show up on the last executed command list and I can't find anything about it on the net. I just want to execute the command this button invokes.

my code:

import bpy from bpy.types import Menu 

class MirrorPicker(bpy.types.Operator):
    bl_idname = "mirror.picker" 
    bl_label = "Mirror Picker" 

    def execute(self, context): 
        bpy.ops.object.modifier_add(type='MIRROR') 
        # the eyedropper code goes here somewhere
        return {'FINISHED'} 

def register(): 
    bpy.utils.register_class(MirrorPicker) 

def unregister(): 
    bpy.utils.unregister_class(MirrorPicker) 

if __name__ == "__main__": register()
zeffii
  • 39,634
  • 9
  • 103
  • 186
JMurray
  • 23
  • 3
  • 1
    related: http://blender.stackexchange.com/questions/30487/object-selection-box-with-eyedropper, but if you could make a similar operator that picks up the active object like in animation nodes. – zeffii Nov 08 '15 at 11:12
  • so, the 1st link says that it can't be done with python. and where do i look for it in the animation nodes link you provided. if implementing manually means some uber level coding then i'm out of luck as i just do basic scripting to streamline my modeling workflow :) – JMurray Nov 08 '15 at 11:14
  • then we can mark it as duplicate, because the answer is still the same. – zeffii Nov 08 '15 at 19:53
  • Stumbled upon this (due to a link from zeffii) https://github.com/CGCookie/retopoflow/tree/63228e8ea25abc48388d83c534fbdc07ca53c61a/op_eyedropper doesn't show an eyedropper cursor, but works the same. – batFINGER Nov 10 '15 at 08:30

0 Answers0