[Bf-python] Getting operator information and a few other things

andyvandalsem andyvandalsem at gmail.com
Mon Aug 28 08:07:21 CEST 2017


Hi guys! After days of searching the forums I'm hoping to get some tips from
the experts on a few roadblocks I've hit writing an add-on. My previous
efforts to get advice on stackexchange and blenderartists have been hit and
miss so I thought I'd try the mailing list. I hope that's allowed! Thanks in
advance! 

I'm invoking the 3D manipulator from inside an operator using this code: 
*manip_test = bpy.ops.view3d.manipulator('INVOKE_DEFAULT')*

I can then find out if the manipulator was clicked on by doing this:
*manip_test_result = (manip_test == {'FINISHED'})*
since not clicking on the manipulator returns {'PASS_THROUGH'}. 

So I want to do a few things:

*1)* If manip_test == True I want to know what the value of the
constraint_axis property was. Basically, I want to know which axis was
clicked on. This information prints to the info bar if you set
bpy.app.debug_wm = True in the console:

*bpy.ops.view3d.manipulator(constraint_axis=(False, False, True),
constraint_orientation='GLOBAL')*

but I don't know how to get it through script. I need this information as
soon as the manipulator returns {'FINISHED'}.

*2)*I want to invoke the manipulator with "use_planar_constraint" set to
False. Using ('INVOKE_DEFAULT'), if you click on the manipulator while
holding shift it constrains translations to the two "un-clicked" axis'. It
does this despite having disabled the 3D Manipulator in the keymap! 

I don't want it to do this but I also can't figure out how to make the
manipulator accept keyword arguments even though the api docs say there are
5 I should be able to use.  Manipulator Op documentation
<https://docs.blender.org/api/current/bpy.ops.view3d.html?highlight=manipulator#bpy.ops.view3d.manipulator>   

*3)*Lastly, is there any way possible to invoke border_select through script
so that it begins immediately in rectangle drawing mode, rather than the
infinite cross which requires an additional input to begin drawing the
border selection? 

The source code says border select is looking for a 'TWEAK' event to begin
drawing, but setting my operator to to use a tweak event in the keymap still
doesn't work.

Again, thanks for any help. I'm so close to having this thing working the
way I want!

Andy 







--
View this message in context: http://blender.45788.x6.nabble.com/Getting-operator-information-and-a-few-other-things-tp166267.html
Sent from the Bf-python mailing list archive at Nabble.com.


More information about the Bf-python mailing list