Mirror Matrix

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 25 Nov 2020, 21:04 Thanks!
Why do you get this Alert?
Cube Mirror X.png
It seems that Z is the only one that works like you would expect
XYZ.png
X & Y just seems to Copy
Can you give a simple example how to use this with a simple Cube?
The alert says that the vertices are not directly mirrored. So if you had an asymmetrical shape like the letter "P" it would still be oriented the same way. If it is a mesh the the vertices will be altered so the P is backward after the mirror.

Move your cubes away from the X=0 and Y=0. It's like above it will mirror but the shape is symmetrical so you can't see it.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Ah okay, thank you for the explanation!
Do you see and issue changing the Alerts to Status messages?
I substituted this line in your errorDisplay script,

Code: Select all

//		System.Alert(ErrorList.replace(";", "\n"));
		Node.Value("/Status Line", "Model") = ErrorList
and added a delayed script that clears the message
errorDisplay.png
Also if you delete an object's Mesh con and run Mirror, the object is still copied
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 25 Nov 2020, 23:32 Ah okay, thank you for the explanation!
Do you see and issue changing the Alerts to Status messages?
I substituted this line in your errorDisplay script,

Code: Select all

//		System.Alert(ErrorList.replace(";", "\n"));
		Node.Value("/Status Line", "Model") = ErrorList
and added a delayed script that clears the message
errorDisplay.png

Also if you delete an object's Mesh con and run Mirror, the object is still copied
If you have several items selected the status line will be useless, only the first error will show for sure with the rest cutoff at the end.
Now I notice a bug, only the first semicolon is being replaced. Need to change the errorDisplay script lines:

Code: Select all

	var semiColonToNewline = /;/g

	if(ErrorList) {
		//System.Alert(ErrorList.replace(";", "\n"));
		System.Alert(ErrorList.replace(semiColonToNewline, "\n"));
	}
This is how the errors should look in the alert. That would be too much for the status line.
properStackedErrors.jpg
properStackedErrors.jpg (39.28 KiB) Viewed 2799 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Okay, I see.
The change works.
Thanks!
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

Update December 2020

Fixes a bug when mirroring scaled objects. The scale was being applied twice because of the mirror process.
Adds support for the upcoming NURBS patches and curves.

I'm releasing this one early because of the scaling bug that was just discovered.

http://clintons3d.com/plugins/truespace ... rrormatrix
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

MirrorMatrix.png
MirrorAlert.png
MirrorAlert.png (7.15 KiB) Viewed 2755 times
Results.png
Results.png (30.16 KiB) Viewed 2755 times
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

Darn, that one was fixed already. I must have updated the old version of the script.
The bug in the error display is also back.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Mirror Matrix

Post by trueBlue »

Here is a chance to use the new Copy command too :mrgreen:
Does this look correct?

Code: Select all

function CopyMesh(firstSel)
{
	if(Node.ConExists(firstSel, "Matrix"))
		nurbsNode = Node.Owner(firstSel);
	else
		nurbsNode = firstSel;

	if(Node.ConExists(nurbsNode, "isaCurve")) {
		Node.Copy(nurbsNode, Node.Owner(nurbsNode));
Node.ConRemove(nurbsNode, "LE2Data")
		return;
	}

	if(Node.Exists(nurbsNode + "/CP to patch CP")) {
		Node.Copy(nurbsNode, Node.Owner(nurbsNode));
Node.ConRemove(nurbsNode, "LE2Data")
		return;
	}

		
	Node.Copy(firstSel, Node.Owner(firstSel));
Node.ConRemove(firstSel, "LE2Data")
}
Can you share the script name, line #, and command for the missing return statement?
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

trueBlue wrote: 07 Dec 2020, 17:42 Here is a chance to use the new Copy command too :mrgreen:
Does this look correct?

Code: Select all

function CopyMesh(firstSel)
{
	if(Node.ConExists(firstSel, "Matrix"))
		nurbsNode = Node.Owner(firstSel);
	else
		nurbsNode = firstSel;

	if(Node.ConExists(nurbsNode, "isaCurve")) {
		Node.Copy(nurbsNode, Node.Owner(nurbsNode));
Node.ConRemove(nurbsNode, "LE2Data")
		return;
	}

	if(Node.Exists(nurbsNode + "/CP to patch CP")) {
		Node.Copy(nurbsNode, Node.Owner(nurbsNode));
Node.ConRemove(nurbsNode, "LE2Data")
		return;
	}

		
	Node.Copy(firstSel, Node.Owner(firstSel));
Node.ConRemove(firstSel, "LE2Data")
}
Can you share the script name, line #, and command for the missing return statement?
It's in the process of being completely rewritten, so it answer will come later.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Mirror Matrix

Post by clintonman »

Re Released

Put the fixes from the previous release back in place

Improved camera and light rotations
When the copy options is used, the copy gets mirrored instead of the original - trueBlue request
Works with group objects
Copied nodes will arrange themselves in the link editor - trueBlue tip
Works with individual members of groups
Clinton Reese

http://clintons3d.com
Post Reply