Anyone here possibly make a virtual mirror script?

It would be incredibly useful for modeler, my mel friend said he would do it , but he has noidea how to freeze translations of vertices. if someone knew how to freeze them in X than just have all the verts like on a Y axis only move in Z and Y that would be really increible. but i figured i would giveit a shot by asking.

instance and scale by -1 along the axis you need! (before thet youd want to place the pivot at the place where you want to mirror)

yah except that is notvirtual mirror. anyone have an idea how to make this?

Then what is a virtual mirror? if you dont want a cloned object and the otherside that keeps linked to its parent then what do you need.

Anyway i had some spare time and came up with this. Its still lacking translation and for some reason it doesent like if you rotate it along the plane... etc so its still buggy but, ill have a look at it later (yesyes iknow id need to disconnect one plug atleast, and connect the translates and rotates of originals, but what do you expect form 20 mins of work).

{
string $mirrorList[],$mirrorObject[],$mirrorObjectShape[],$instance[],$mirrorGroup,$mirrorFunc,$counterRot;
$mirrorList= ls -sl;
{//lets make the mirror to non renderable etc could be split as a general proc.
$mirrorObject=polyPlane -w 3 -h 3 -sx 1 -sy 1 -ax 1 0 0 -tx 1 -n mirrorPlane -ch 0;
$mirrorObjectShape=listRelatives -s $mirrorObject[0];
setAttr ($mirrorObjectShape[0]+".primaryVisibility") 0;
setAttr ($mirrorObjectShape[0]+".visibleInReflections") 0;
setAttr ($mirrorObjectShape[0]+".overrideEnabled") 1;
setAttr ($mirrorObjectShape[0]+".overrideShading") 0;
}
$mirrorFunc=group -em -name mirrorFunc;
$counterRot=group -em -name counterRotation;
parent $counterRot $mirrorFunc;
parent $mirrorFunc $mirrorObject[0];
for($object in $mirrorList){
$instance=instance -n ($object+"Mirror") $object;
parent $instance[0] $counterRot;
}
setAttr ($mirrorFunc+".scaleX") -1;
$countRotCalc=createNode multiplyDivide -n counterRotationCalculator;
connectAttr -f ($mirrorObject[0] +".rotate") ($countRotCalc+".input1");
connectAttr -f ($countRotCalc+".output") ($counterRot+ ".rotate");
setAttr ($countRotCalc+".input2") -1 -1 -1;
}

Or do you perhaps need a camera to be rendered from this mirror position... This script can be done to do that too. Except you cant instance cameras youd need to copy them.

joojaa, i just got a new mac, so i cant test out your script until i get back on my pc. will it keep the verts on the Y axis from breaking the mirror?

Aaah yeah, you want a plane projection no prob. But just out of curiosity why cant you just cange to a ortographic view? Offcourse if you scale a object by 1 0 1 it will flatten it on its workplane now all ai need to do is move it one more time and....!

Is this for some export puprposes?

But having one on y is about as hard as this. It could be made tidyer but its just a fast prototype to get you going

{
string $mirrorList[],$object;
$mirrorList= ls -sl;
for($object in $mirrorList){
$instance=instance -n ($object+"Mirror") $object;
move 0 0 0 ($instance[0]+".scalePivot") ($instance[0]+".rotatePivot");
setAttr ($instance[0]+".scale") 1 0 1;
connectAttr -f ($object+".rotate") ($instance[0]+".rotate");
connectAttr -f ($object+".scaleX") ($instance[0]+".scaleX");
connectAttr -f ($object+".scaleZ") ($instance[0]+".scaleZ");
connectAttr -f ($object+".shear") ($instance[0]+".shear");
connectAttr -f ($object+".translateX") ($instance[0]+".translateX");
connectAttr -f ($object+".translateZ") ($instance[0]+".translateZ");
{//lets make the mirror to non renderable etc could be split as a general proc.
$mirrorObjectShape=listRelatives -s $instance[0];
setAttr ($instance[0]+".primaryVisibility") 0;
setAttr ($instance[0]+".visibleInReflections") 0;
setAttr ($instance[0]+".overrideEnabled") 1;
setAttr ($instance[0]+".overrideShading") 0;
setAttr ($instance[0]+".overrideDisplayType") 2;
}
}
}

i am trying to get your script running joojaa, i cant seem to get it to work i get a syntax error. im selecting all of it and exectuing it. am i doign this right. also are we talking about the same virtual mirror. the one from wings3d/miraia/clay3d???

Yes umm you arent fluent in mel sorry the scripts are encapsulated so that they work on any selected object but they dont contain checks for user error, so you would need to have something selected in order to execute them... that said however they shouldnt syntax error did you manage to copy all the {} enclosing the code too (se if you miss even one youll get a syntax error)? Just recheked that they work on maya 5 fine.

Also if you ddnt use copypaste make sue you use instead of

hmm jooja, i dont know what your scripts doing, but it dont look like wings3d virtual mirror from the image you have, is there anyway you can do what i show in this video? like all the verts on the Y axis only move in y z no x.

http://www.chemicaldust.com/VirtualMirror.rar

And thet would be instancing and scaling by -1 along the axis you need keeping the rest 1. The first thing you said wasnt it. Note my cript isnt made to work exactly like the wings moirror but its amirror nevertheless.

So my first post was exactly what you were after in the firstplace.

eg to mirror over y would be to make a instance copy scaing it by 1 -1 1 and viola. (before that wou would like to place the pivot at the plane off wirror offcourse).

PS. please test what i say before you tell me it isnt what you are after. Now only the ui does need to be build working in the same way.

PPS. do you have any idea on how to run a melscript that isnt defined a s a global proc?

PPS. and why you want to call it virtal is beyond me its miror... except you want it to be interactive. A outline on how to be done (or atleast start is in script 1)

Hmmm well i did call it virtual mirror in my frist post...

also i did say i could not get your script to run, i could not find the procedure for it. i tried selecting it all and running it.

and i call it virtual mirror....because thats what its called in wigns3d, mirai, clay3d...i would have tried out your script again after yout old me how to run it, but i was on my mac still. ill give it a go today.

I tried your script jojaa, is there anyway to make the "seam"down the middle not break apart? like in that video i made.

Yes but its better not to close the seam untill you are totaly ready. Otherwise you will get a huge speed panaltty, al

but ...thats the point of a virtual mirror, the seam down the middle does not comeapart, you can also keep modeling and it updates on both sides. did you watch the video i uploaded? it shows everything a virutla mirror does in wings3d.

Yes yes yes It works exacltly like your virtual mirror as long as the mirroplane position is intact (i mean the script vcan easily be accomodated for a moving mirrorplane but not if the plene hats non planar)! Aloso in teh vide theres nowhere a place where they unplanarice the pirrorplane, Now taht gets hardboiled for teh calculator to do since surrendy the OTHER side sint a mirrored copy anymore casuing the linkage to crash!

The script is however nowhere nearly prduction ready. Im working on a way to fetch teh mirrirplane of a poly. in as easy way as possuble (also looking for a way to sooothe the non connected edge properly,and a cleanupscript companion but ista on my todoolist andd just dropped down in prioritty due to other contracts that came rolling in)

Se i have a working script for this but its not releaseble and only works on x y z planes was hoping to epand taht a bit but...

NOT everything is doable exactly like you want in mel atough if you wish i could do it via the api for you.

My hourly rate is 300$ for stuff like this!

My hourly rate is 300$ for stuff like this!

Very standard rate... se it includes pay for investment as well as taxes and stuff, and the possibility i would need to update it reccompile it, or release the code etc. etc. (you se if i woulld work for you my total tax rate would be about 50%, or initialy 60% but id get moeny back later offcourse), im not suggesting you pay tough.

Besides its not uncommon for a expeert to make more money than his boss from where i come form.

Ps. by the way its quite far fetched to say that keeping the seam is the point. THe point is to se how the final mirrored object looks like.
Vhy do you need it to BE exactly the same i mean it can easily be done 90% of the way without much hustle. I mean whou would work for less than that? I mean i can easily get half this doing anything esle too. Its better than having no tool.

Also its even quite easy if you can live with a fake seam, and ensure planarity of the seam too. Then just dice it when your ready. I mean ITS faar better tthan nothing! ofcourse my advice on this forum is free. I mean i can shouw you on your way but i cat realy work for free, life isnt charity you know.

umm...i could barley make out any of the bottom half of your last post. i mean if you could make a mel script to keep the seam from opening on the y axis, please do. the verts on the y axis should only move in Y, Z, thast all it needs and, for the other side to update as you model. thats all i was wanting, cause then it would be virtual mirrored.

As i said you dont realy need a script fo that as i said earlier just make a instance of the object move its pivot to the planeof pivot and scale by 1 -1 1.then group and manipulate the group whenever you move teh object does the exact same thing. But im woekinn on the arbitraty mirror sccript for an hour or so today (because i need to wait for the food to cook anyway.)

Although I didn`t read the whole post, it seems that your main interest lies in some sort of "mirrorMoving" components.

This is really easy to achive.

But a reall mirror will also work if you change the objects history - and that is where all the trouble starts.

To my mind, it would be really tricky, and even if you make it somehow, it would probably be quite slow - even if you use the API.

If you ask me, Maya is not, by architecture, a good modeller.
Have a look at Max. Its much faster when it comes to changing the topology, just because it doesn`t keep all the history, and probably because it is more eficient internally.

If you change the topology of Maya Meshes via the API, there is so much overhead !

The only good way to have a virtual mirror is to implement your own meshShape in Maya, whose architecture was made to ensure speed in all cases, and which can be accessed more directly ( sure, because you implemented everything yourself ).

This does also mean that the default Maya Mesh Tools like extrude won`t work on this new meshShape, so everything had to be redone.

I am going to do that for BPT 2.0, if I do that.

Finally, I would really suggest that Alias does that Mirror thing, because they have have the best access to they meshes, and to they engine of course.

But will they do ?
Look at their Smooth Proxy thing - its basically a script, which it not as good as CPS ... .

So, are they able to do that ?

To my mind, Alias is not interested in making Maya a better modeler at all, so the chances that they will ever do that, are bad, at least.

Regards,
Sebastian