SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Current viewport info
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 29-12-2003, 05:06 PM   #1
DigitalDez
Registered User
 
DigitalDez's Avatar
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Current viewport info

Is there a way to extract which viewport is currently active?

What I'm trying to do is create a simple (newbie) script to generate nurbs curves. I'd like it to be intuative like the default "Circle" and "Square" commands where they draw out perpendicular to the current viewport selected. Yet, if the Persp or a non-orthographic viewport is selected, it defaults to the top for creation. Any ideas?
DigitalDez is offline   Reply With Quote
Old 29-12-2003, 08:02 PM   #2
dannyngan
Registered User
 
dannyngan's Avatar
 
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
getPanel -withFocus
__________________
Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
dannyngan is offline   Reply With Quote
Old 29-12-2003, 10:18 PM   #3
DigitalDez
Registered User
 
DigitalDez's Avatar
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help.

I tried to add the line of code you gave me and I did not get an error message, but I also did not receive the results I was hoping for.

I'm trying to create a small script that will draw a facited nurbs polygon shape. Here is what I have so far:

My Code:
circle -nr 0 1 0 -r 1 -d 1;
rename "nurbsPoly1";

I'm trying to get rid of the blue code above so that Maya looks for which viewport is active and draws my nurbsPoly1 perpendicular to the active viewport or top viewport if Persp/non-orthagonal is active. Where would I place the "getPanel -withFocus;" in the syntax above to achieve this result?
DigitalDez is offline   Reply With Quote
Old 21-01-2004, 07:55 PM   #4
strarup
Subscriber
 
Join Date: Jan 2003
Location: Denmark
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi DigitalDez,

eh... I'm not sure if understand your question correctly, but whatever you do, all the viewports are members of the same workspace... and have the same coordinates to operate with...

so if you create a Nurbs sphere or any other object, it will be on the same spot (coordinate) in all the "modelling" Viewports...

hope this made sense...

regards

Strarup
__________________
------------------------------------------------
Alex V. U. Strarup

One mistake can ruin it all...
strarup is offline   Reply With Quote
Old 01-02-2004, 07:50 AM   #5
dannyngan
Registered User
 
dannyngan's Avatar
 
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Thanks: 0
Thanked 1 Time in 1 Post
Default

One thing you could do is rotate the nurbs circle 90 degrees on either the X or Z axis to match whatever view has focus.
__________________
Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job
dannyngan is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
where can i post info about 3D job openings? atadami Members Lounge 3 03-12-2010 09:51 AM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.