pymel.core.context.texSmudgeUVContext¶
- texSmudgeUVContext(*args, **kwargs)¶
This command creates a context for smudge UV tool. This context only works in the texture UV editor.
Flags:
Long Name / Short Name Argument Types Properties dragSlider / ds unicode radius | none Enables the drag slider mode. This is to support brush resizing while holding the ‘b’ or ‘B’ button. effectType / et unicode fixed | smudge Specifies the effect of the tool. In fixed mode, the UVs move as if they are attached by a rubber band. In smudge mode the UVs are moved as the cursor is dragged over the UVs. exists / ex bool Returns true or false depending upon whether the specified object exists. Other flags are ignored. functionType / ft unicode exponential | linear | constant. Specifies how UVs fall off from the center of influence. history / ch bool If this is a tool command, turn the construction history on for the tool in question. image1 / i1 unicode First of three possible icons representing the tool associated with the context. image2 / i2 unicode Second of three possible icons representing the tool associated with the context. image3 / i3 unicode Third of three possible icons representing the tool associated with the context. name / n unicode If this is a tool command, name the tool appropriately. pressure / prs float Pressure value when effect type is set to smudge. radius / r float Radius of the smudge tool. All UVs within this radius are affected by the tool smudgeIsMiddle / sim bool By default, the left mouse button initiates the smudge. However, this conflicts with selection. When smudgeIsMiddle is on, smudge mode is activated by the middle mouse button instead of the left mouse button. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.texSmudgeUVContext
Example:
import pymel.core as pm # Create a poly plane pm.polyPlane(w=10, h=10, sx=10, sy=10, n='pPlane1') # Result: [nt.Transform(u'pPlane1'), nt.PolyPlane(u'polyPlane1')] # # Select all UVs pm.select('pPlane1.map[0:120]', r=True) # Create a new smudge UV tool context, set the effect type to smudge mode, set the radius to 0.1 and pressure to 0.2, then switch to it # In order to use this tool to smudge the UVs of pPlane1, you must open the texture UV editor pm.texSmudgeUVContext('texSmudgeUVContext1', effectType='smudge', r=0.1, prs=0.2) # Result: u'texSmudgeUVContext1' # pm.setToolTo('texSmudgeUVContext1')