[Maya-Python] UI update using pymel

796 views
Skip to first unread message

shawnpatapoff

unread,
Apr 19, 2010, 1:54:31 PM4/19/10
to python_inside_maya
Not sure if this is in the pymel docs. How do I force a maya refresh
and viewport redraw when manipulating objects via pymel.

Right now I'm running this:
j=ls(createNode('joint', ss=True))[0]
j.setRadius(.5)

Nothing gets updated until a selection is made, UI and the visible
radius of the joint. Do I have to tell maya to update?

Cheers,
Shawn

--
http://groups.google.com/group/python_inside_maya

Ofer Koren

unread,
Apr 19, 2010, 2:27:31 PM4/19/10
to python_in...@googlegroups.com
Try this:

pm.refresh(force=True)

- Ofer
www.mrbroken.com

--
http://groups.google.com/group/python_inside_maya

shawnpatapoff

unread,
Apr 19, 2010, 2:47:25 PM4/19/10
to python_inside_maya
excellent, thank you.

On Apr 19, 11:27 am, Ofer Koren <kor...@gmail.com> wrote:
> Try this:
>
> pm.refresh(force=True)
>
> - Oferwww.mrbroken.com
>
> On Mon, Apr 19, 2010 at 10:54 AM, shawnpatapoff <shawnpatap...@gmail.com>wrote:
>
> > Not sure if this is in the pymel docs. How do I force a maya refresh
> > and viewport redraw when manipulating objects via pymel.
>
> > Right now I'm running this:
> > j=ls(createNode('joint', ss=True))[0]
> > j.setRadius(.5)
>
> > Nothing gets updated until a selection is made, UI and the visible
> > radius of the joint. Do I have to tell maya to update?
>
> > Cheers,
> > Shawn
>
> > --
> >http://groups.google.com/group/python_inside_maya
>
> --http://groups.google.com/group/python_inside_maya

--
http://groups.google.com/group/python_inside_maya

shawnpatapoff

unread,
Apr 19, 2010, 3:51:01 PM4/19/10
to python_inside_maya
Just did a bit more testing.

If I create a joint:
j=ls(createNode('joint', ss=True))[0]

Then select it, then run:
setAttr(j.radius, .5)

The UI and the channelBox are updated

If I do the same thing but run:
j.setRadius(.5)

Neither the UI or the channelBox are updated.

I can refresh the UI using refresh(force=True), that still doesn't
update the channelBox.
I would expect setAttr to work the same way
as .set(whateverAttribute). Am I possible doing something wrong?

Cheers,
Shawn

Ofer Koren

unread,
Apr 19, 2010, 4:19:02 PM4/19/10
to python_in...@googlegroups.com
Which version of pymel is this?

- Ofer
www.mrbroken.com

--
http://groups.google.com/group/python_inside_maya

shawnpatapoff

unread,
Apr 19, 2010, 4:51:44 PM4/19/10
to python_inside_maya
It's the most recent download, 1.0.2

On Apr 19, 1:19 pm, Ofer Koren <kor...@gmail.com> wrote:
> Which version of pymel is this?
>
> - Oferwww.mrbroken.com
Reply all
Reply to author
Forward
0 new messages