Maya API - view change when Maya panel layout changes?

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
Old 06 June 2009   #1
Maya API - view change when Maya panel layout changes?

Hi,

I have a context class which draws an opengl line-strip over my persp viewport with overlay drawing. But every time my panel layout changes the drawing doesn't work any more for the original view but for the others (top, side etc...). But if I enlarge those the drawing doesn't work there as well. It seems to me that the current view is not quite the right or something. Here is the code for the drawing procedure:


  	// get the current viewport
  	view = M3dView::active3dView();
  	int portWidth  = view.portWidth( &stat );
  	int portHeight = view.portHeight( &stat );
  
  	event.getPosition( viewPosX, viewPosY );
  
  	// set the draw start to the end of the old cycle
  	drawPosXStart = drawPosXEnd;
  	drawPosYStart = drawPosYEnd;
  
  	// calculate the draw end point
  	drawPosXEnd = ( viewPosX / (double(portWidth) *  0.5) ) - 1;
  	drawPosYEnd = ( viewPosY / (double(portHeight) * 0.5) ) - 1;
  
  	// draw the curve
  	view.beginGL();
  	view.beginOverlayDrawing();
  	glColor3f(1.0, 0.0, 0.0);
  	glLineWidth(4);
  	glBegin(GL_LINE_STRIP);
  		glVertex2f( GLfloat(drawPosXStart), GLfloat(drawPosYStart));
  		glVertex2f( GLfloat(drawPosXEnd),   GLfloat(drawPosYEnd));
  	glEnd();
  	glLineWidth(1);
  	view.endOverlayDrawing();
  	view.endGL();
  


Maybe someone knows the problem, has a solution or just a suggestion. Everything is welcome, thanks!
Jonas
 
Old 06 June 2009   #2
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 02:52 AM.


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