move an object on the x,y plane but staying in the 3D view
All  1-12  13-15

Previous
Next
 From:  Michael Gibson
11862.13 In reply to 11862.11 
Hi hadri1, here are some scripts you can set on a shortcut key, copy/paste them in as the "Command" part of the shortcut.

They will get a point for the origin point to use for the cplane and automatically orient the cplane z axis direction to a world axis direction so you can skip the z axis dragging part:

Use this one for z axis (like the Top view):

code:
script:
function DoCPlaneDirZ()
{
	var pp = moi.ui.createPointPicker();

	while ( 1 )
	{
		if ( !pp.waitForEvent() )
			return false;
			
		if ( pp.event == 'finished' )
			break;
	}

	var frame = moi.vectorMath.createTopFrame();
	frame.origin = pp.pt;

	moi.view.setCPlane( frame, false /* Apply to all views */, false /*Orient ortho views*/ );
}

DoCPlaneDirZ();



This one for X axis (like the Right view):

code:
script:
function DoCPlaneDirX()
{
	var pp = moi.ui.createPointPicker();

	while ( 1 )
	{
		if ( !pp.waitForEvent() )
			return false;
			
		if ( pp.event == 'finished' )
			break;
	}

	var frame = moi.vectorMath.createRightFrame();
	frame.origin = pp.pt;

	moi.view.setCPlane( frame, false /* Apply to all views */, false /*Orient ortho views*/ );
}

DoCPlaneDirX();


This one for Y axis (like the Front view):

code:
script:
function DoCPlaneDirY()
{
	var pp = moi.ui.createPointPicker();

	while ( 1 )
	{
		if ( !pp.waitForEvent() )
			return false;
			
		if ( pp.event == 'finished' )
			break;
	}

	var frame = moi.vectorMath.createFrontFrame();
	frame.origin = pp.pt;

	moi.view.setCPlane( frame, false /* Apply to all views */, false /*Orient ortho views*/ );
}

DoCPlaneDirY();


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11862.14 In reply to 11862.12 
For resetting the cplane you can put this on a shortcut key:

script: moi.view.resetCPlane();

I was thinking of how it could be done automatically but it's pretty difficult, it would need to sort of hook itself in to another point pick which may not even be running yet.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  hadri1
11862.15 
It is perfect ! Thanks !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-12  13-15