floating viewports with scripts for shelves?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  04 April 2013
floating viewports with scripts for shelves?

I'm working on a rig and have created curve sliders for certain facial features. I made a seperate camera for it and made it really small elsewhere in the world (just the way i prefer it), and go to that separate viewport to use the sliders. I was wondering since there doesnt seem to be a way to add that specific action to the shelf (orthagraphic views>slider_cam>tear off Copy), is there a script that will do what i want so i can have it do that? If anyone was wondering why, i thought it'd be a neat feature to have it so if someone else used my rig they could click a button on the custom loaded shelf for slider view port.
 
  04 April 2013
Depends on how much scripting you want to do. You need a few UI elements: a "window" a "formLayout" and a "modelEditor" (those are also the commands). The modelEditor command will let you specify a camera to use and the display options.

Do you need some help with the script?

David
__________________
http://www.djx.com.au
 
  04 April 2013
Originally Posted by djx: Depends on how much scripting you want to do. You need a few UI elements: a "window" a "formLayout" and a "modelEditor" (those are also the commands). The modelEditor command will let you specify a camera to use and the display options.

Do you need some help with the script?

David


Well, I kinda posted without thinking tbh, i usually don't like asking for help on something i know nothing about. I'm pretty decent at rigging. but not python/mel. And it just feels weird to ask help on something I've never done before (aside from small mel commands that help with my rigs). I looked at a script on the autodesk help site that seemed to do what i want, and i tried editing it somewhat. One thing is however; i'm not sure if this would be the best way to go about this. Second, if it is the best way, i'm not sure how to specify the camera or have it automatically view as textured mode.
(really i just tried to break down and understand the script, but its still confusing seeing as i haven't learned scripting yet)

Here's the script nonetheless

import maya.cmds as cmds

window = cmds.window('Slider Window')
form = cmds.formLayout()
editor = cmds.modelEditor()
column = cmds.columnLayout('true')

cmds.formLayout( form, edit=True, attachForm=[(column, 'top', 10), (column, 'left', 10), (editor, 'top', 10), (editor, 'bottom', 10), (editor, 'right', 10)], attachNone=[(column, 'bottom'), (column, 'right')], attachControl=(editor, 'left', 10, column))

cmds.modelEditor( editor, edit=True, camera=camera[0] )

cmds.showWindow( window )
 
  04 April 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:56 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.