pymel » Khaos Kollective https://www.khaoskollective.com/tag/pymel/ Don't Sweat The Technique Mon, 24 Oct 2022 04:27:17 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://www.khaoskollective.com/wp-content/uploads/2021/04/cropped-SiteFavIcon-32x32.png pymel » Khaos Kollective https://www.khaoskollective.com/tag/pymel/ 32 32 Maya Pymel UI Layouts https://www.khaoskollective.com/2022/10/23/maya-pymel-ui-layouts/ Mon, 24 Oct 2022 04:27:17 +0000 https://www.khaoskollective.com/?p=12990 The post Maya Pymel UI Layouts appeared first on Khaos Kollective.

]]>

Ok… Maybe I overreacted.

In the last post, I was questioning the logic behind the way things were structured for pymel UI layouts. The format is new to me so it seemed overly complicated for someone who has spent plenty of time playing with HTML/CSS table layouts. There’s a hierarchy there that makes sense to me and positioning is x and y values in relation to the pixels across the screen or a percentage of them.

The posts that follow will have more detailed information about how several pymel UI layout commands work and I’m going to try to give solid examples that’re helpful for someone that knows how to code, but doesn’t know the syntax.

Ultimately, my goal with these posts is to help myself absorb the information so that I can become more fluent with pymel and hopefully it’ll provide guidance to others in the process.
If you’re struggling to retain information on the topic, try writing notes or commenting on these blog posts. That’s what I’m doing. It’s just in a public format.

 

Alright then, what are pymel ui layouts?

They’re a collection of commands that allow you to format your cool new user interface in different ways. Below are the available commands according to the maya help site. I’ll be going through each one in detail with separate posts and videos. Once those posts and videos are done, I’ll update the info in each command’s panel. 

Commands

columnLayout

This command creates a layout that arranges its children in a single column.

Create a dockable control, also known as tool palette or utility window. Dock controls are secondary windows placed in the dock area around the central control in a main window. Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked). Dock control consists of a title bar and the content area. The titlebar displays the dock control window title, a float button and a close button. Depending on the state of the dock control, the float and close buttons may be either disabled or not shown at all.

This command creates a layout that arranges its children along a single line (either horizontal or vertical). Depending on the value of the -wrap boolean flag (default is false), if the layout’s parent cannot fit all the children on one line, the children will either wrap onto the next line(s) or be truncated.

This command creates a form layout control. A form layout allows absolute and relative positioning of the controls that are its immediate children.

This command creates frame layout control. A frame layout may draw a border around its child controls as well as a display a title. Frame layouts may also be collapsable. Collapsing a frame layout will make the child of the frame layout invisible and shrink the frame layout size. The frame layout may then be expanded to make its child visible. Note that the frame layout may have only one child control. If you wish to have more than one child inside a frame layout then you must use some other control layout as the immediate child of the frame layout.

This layout arranges children in a grid fashion where every cell in the grid is the same size. You may specify the number of rows and columns as well as the width and height of the grid cells.

This command allows you to edit or query the properties of any layout. The argument is the name of the layout.

Create a layout containing a menu bar. The menu bar will appear and behave similar to any menu bar created with the ‘window -menuBar true’ command. Menus may be created with a menuBarLayout as their parent. Child controls are simply positioned to fill the menuBarLayout area beneath the menu bar consequently, some other layout should be used as the immediate child.

This command creates a pane layout. A pane layout may have any number of children but at any one time only certain children may be visible, as determined by the current layout configuration. For example a horizontally split pane shows only two children, one on top of the other and a visible separator between the two. The separator may be moved to vary the size of each pane. Various other pane configurations are available and all display a moveable separator that define the size of each pane in the layout.

This command creates a rowColumn layout. A rowColumn layout positions children in either a row or column format.

This command creates a layout capable of positioning children into a single horizontal row.

This command creates a scroll layout. A scroll layout is useful for when you have a number of controls which cannot all be visible at a time. This layout will display a horizontal and/or vertical scroll bar when necessary to bring into view the hidden controls. Since the scroll layout provides no real positioning of children you should use another control layout as the immediate child.

This command creates a new empty shelf layout. The shelf layout can accept drops of commands scripts. Use the addNewShelfTab MEL command to add a shelf to the top level shelves.

This command creates/edits/queries a shelf tab group which is essentially a normal tabLayout with some drop behaviour in the tab bar. A garbage can icon can appear in the top right corner to dispose of buttons dragged to it from shelves.

This command creates a tab group. Tab groups are a specialized form of control layouts that contain only control layouts. Whenever a control layout is added to a tab group it will have a tab provided for it that allows selection of that group from amongst other tabbed control groups. Only one child of a tab layout is visible at a time.

Create a toolbar. Tool bars are movable panel that contains a set of controls. They are placed in the tool bar area around the central control in a main window. Tool bars can be moved inside their current area, moved into new areas and floated.

Creates and manages the widget used to host windows in a layout that enables docking and stacking windows together.

The Workspace Layout Manager loads and saves the layout of the various toolbars and windows in the user interface. This command allows listing and managing their properties.

The post Maya Pymel UI Layouts appeared first on Khaos Kollective.

]]>
Making A Control Creator For Character Rigging https://www.khaoskollective.com/2022/10/20/making-a-control-creator-for-character-rigging/ https://www.khaoskollective.com/2022/10/20/making-a-control-creator-for-character-rigging/#comments Thu, 20 Oct 2022 14:53:22 +0000 https://www.khaoskollective.com/?p=12977 The post Making A Control Creator For Character Rigging appeared first on Khaos Kollective.

]]>

Scripting a toolset that’ll create controllers for my rigs will take me to another level.

This week’s agenda has been another adventure into Pymel and the efficiencies I can achieve by applying my scripting experience into rigging. 

As you can see in the image above, I’ve begun to learn how to place buttons in a UI layout within Maya. Pymel is a pretty welcoming language, but I hope whoever came up with the layout commands jams their toe on a doorway tonight… Why was this created like this?! Maybe I’m being too critical of something I’m still learning, but I rode the struggle bus for hours. There’s nearly no decent videos on this topic and the documentation is vague in the important areas.

So, I’ve made a mental note to make videos covering the subject in detail in the future. As an up and coming technical artist/character rigger, it’s your duty to make the path to being proficient in the industry a little less bumpy on your way up. If it’s not, it should be. That’s my opinion at least…

Anyway, into the details of the overall plan.

The posts that follow this one will be more detailed about how each part is made.

Toolsets in Maya can be extremely helpful by minimizing time spent doing repetitive tasks. As a character rigger, your goal is to provide a system that is intuitive from the animators perspective. In order to do that, consistencies need to exist in the rig you create.
If an animator hops from one character to another and the icons are all different, operating in different ways and randomly colored, you’re asking for trouble. Or you think it’s funny to watch others struggle to make something great and that makes you just– you’re just evil.

Therefore, toolsets are created. If you use a standard toolset to make the rig, you’ll be using controllers that’re clearly defined. Well.. Hopefully, the toolset gives that level of detail. Aside from that, it’ll also limit errors made on the rig if the same steps that’re usually repeated multiple times are scripted instead.
I can’t be the only one that’s gotten to the polishing stage of my skin weights only to realize that I never froze transforms on the finger joints…

In conclusion

As I said earlier, the posts that follow this will go into detail on the various parts of the toolset that I’m creating. I’m not sure I’ll release the full code when it’s completed, but I’m planning to share the journey as I create it. I’m still learning Pymel and my code will have plenty of reasons to return to it and make it more efficient. With some luck, sharing the iterations will provide a good source of information for you and others to create their own.

Related videos:

Coming soon…

The post Making A Control Creator For Character Rigging appeared first on Khaos Kollective.

]]>
https://www.khaoskollective.com/2022/10/20/making-a-control-creator-for-character-rigging/feed/ 1