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 Tools Display Modes
  06 June 2009
Maya API - view change when Maya panel layout changes?


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
  	glColor3f(1.0, 0.0, 0.0);
  		glVertex2f( GLfloat(drawPosXStart), GLfloat(drawPosYStart));
  		glVertex2f( GLfloat(drawPosXEnd),   GLfloat(drawPosYEnd));

Maybe someone knows the problem, has a solution or just a suggestion. Everything is welcome, thanks!
  06 June 2009
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
Society of Digital Artists

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

All times are GMT. The time now is 09:22 PM.

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