mardi 9 février 2021

DragAttrContext to easy select DisplayLayers

Just trying to Mimic a Photshop 'Drag and select function' to easily turn layers 'on' or 'off' by dragging the cursor over the boxes of their visibilities.....I am way new to code and this is my 1St one trying to hash out.... I know the dragAttr has to be the command, BUT as far as actually connecting the action to the Displaylayers visibilities has been a stumper...just gettin; indent & syntax's but Maya is tryingto use thr Drag action I believe....thanks

import maya.cmds as cmds

cmds.dragAttrContext( 'myDragAttrContext')

if objectArray[0], visibility=True

else(): cmds.dragAttrContext( 'myDragAttrContext', select=True, connectTo=( objectArray[0], visibility=False ) cmds.setToolTo( 'myDragAttrContext' )

Aucun commentaire:

Enregistrer un commentaire