PDA

View Full Version : Seamless Symmetry modelling


lkruel
04-17-2006, 05:19 PM
Hey all,

Here's the idea, I want to code something like the Silo's symmetric modelling in the demo video where you have a seamlessly combined mesh and you can model as if you had 2 halfs instanced. Probably going to have to be in the API. I'm wondering if anyone can point me the right way on how I would go about this.

I'm thinking create a plane on the XY axis and then figure out a way to find the mirrored vertex in the other side and copy it. But that's just an idea. I'm going to do some research on it and post the progress here, if anyone wishes to help the more the merrier, I think itd be a pretty useful tool since a lot of people model in halfs and then have to merge down the middle.

Iconoklast
04-18-2006, 02:38 PM
Take a look at this thread on the Silo forum. It's for a plugin that uses a plane as a mirror, similar to what you've suggested. Maybe it might provide some insight.

http://www.silo3d.com/forum/showthread.php?t=3397

Please let us know how your progress is doing as this would be handy for us Maya users.

cpan
04-18-2006, 04:06 PM
just wondering... what does silo's tool has that maya's Mirror Cut tool doesn't have?

-edit, it's Mirror Cut not Merge Cut ehe... too much nurbs these months and forgot polys lol :D

:)

GennadiyKorol
04-18-2006, 04:11 PM
I also tried writing something like that about a year ago. It was a mel script that was working. The only problem here is that it's all faked. With maya's architecture it's near to impossible to do this right nor viaapi nor via mel. That should be something that's implemented inside maya's polygon shape. So that every time shape reupdates, it builds the symmetrical mesh by itself. This should also preserve the seam, shape itself should not allow transofming the seam verts in a symmetry axis.
My mel script was a seam preservation system. It snapped the seam verts to the center with cluster deformer. Every time shape updates I reapply the deformer. It all works, but again it's just a fake. It will not work with click dragg this way, though it will work with any deformer or topology modification node. You could implement the same with api, writing a deformer node that will snap the vertexes to world space 0 (or your model center) in mirror axis. But everytime someone will add another node on top of that this deformer it will no longer have effect on that node. So you should always keep track of what user does, and behave accordingly - in this case move the deformer up in stack. If the poly operation created intermediate mesh you will have to reapply the deformer again and again. That can become very complex sometimes, so I don't consider this option as a real stable solution. The best solution is to write your own polygon shape in API that will handle everything inside. But then you will have to eather make your own polygon tools for it, or somehow make the existing tools work on your mesh. Perhaps by creating a mesh attribute for your shape and performing all the operations on it. But again it will take tons of time for practically inventing a wheel.

Only Alias programmers could actually do it right. With the access to the actual maya architecture they could implement that with ease. API or MEL just don't have this type of access to maya.

lkruel
04-19-2006, 01:44 AM
Hmm, good feedback.

The way I was thinking though it for it to calculate the distance from the vertex to the axis and then look for the other vertice in the opposite side and do the same thing to it. Wasnt really about keeping the seam together, it was more of eliminating the seam all together and work on a whole mesh, but have the ability to work in a "mirrored" way.

I might be able to be done in MEL as a hack, but it can definetly be done in the API.

I got David Gould's book and I looked over it and it's not going to be as easy as a predefined "instance" function. but it can surely be done.

I'll probably do some more research today and then start playing with it tomorrow. I've decided to keep it open source too, so whichever way I decided to go I'll post updates on this thread so keep subscribed to see crappy coding, and hopefully contribute to make it not suck and even implemented in Maya 8 =)

Buexe
04-19-2006, 08:26 AM
But you know that the functionality you are talking about already works for the move tool, do you?
In the tool options turn on Reflection and the appropriate axis.
Works also for multiple selected vertices.

lkruel
04-19-2006, 12:41 PM
I didnt know that, but that's good to know. what's I'm looking for though is to be able to add an edge loop and have it be added on the other side, or extrude a face, etc etc. but it's crazy how after years of working with Maya you keep finding stuff.

cpan
04-19-2006, 12:45 PM
I didnt know that, but that's good to know. what's I'm looking for though is to be able to add an edge loop and have it be added on the other side, or extrude a face, etc etc. but it's crazy how after years of working with Maya you keep finding stuff.

The Polygons > Mirror Cut command does exactly this...
it mirror your object by a plane, it merge the vets and it updates it realtime :)

GennadiyKorol
04-19-2006, 01:58 PM
The way I was thinking though it for it to calculate the distance from the vertex to the axis and then look for the other vertice in the opposite side and do the same thing to it. Wasnt really about keeping the seam together, it was more of eliminating the seam all together and work on a whole mesh, but have the ability to work in a "mirrored" way.

I might be able to be done in MEL as a hack, but it can definetly be done in the API.

I got David Gould's book and I looked over it and it's not going to be as easy as a predefined "instance" function. but it can surely be done.

You don't seem to totally understand the maya architecture. First understand how construction history works, how the transformations via deformers and more/rotate/tools tools works and how everything is connected. API is a wrapper over maya's internal classes that we have no clue about and no access to. As I've mentioned above you can write either a deformer with api and then reupdate it every time doing a fake, or writing a shape node which does the work internally. The first solution is clumsy and will not support many of maya's integrated features, such as click dragg transformation. The second one is just not efficient in terms of developing, you'd have to totally write your own shape node that willl handle opengl drawing, deformation, topoly modifications, textures, normals and all that jazz. It would be just a wheel invention. Again repeating myself, there's no normal way nor via API or mel to do what you're after. And the problem here is in maya archetecture and not in the way to build a mirror for a component...

As a conlusion for myself, I decided to write tools that will do symmetry and seam preservation themselves. I find this even better solutions since, say extrude tool would have to delete the faces lying on YZ plane when extruding the border face. So basically I find it more correct to handle the symmetry on the tool level and not on shape level, since shape has no clue about what operation has been performed, it only takes an input geometry from that node. Forcing it to behave correctly could be trickey and not reliable. The best thing is to force those who know exactly what they are modifying in the topology or shape - the tools to preserve symmetry.

Anyways I hope you take my experience into consideration before starting your own research :).

Cheers,
Henry.

lkruel
04-19-2006, 06:05 PM
yashu, what I'm looking to do is similar to the Mirror Cut tool, but a couple of beefs I have with the mirror cut tool is that it uses a Merge Vertex node which can merge vertices that you dont want, so a better solution would be to find that border edge and merge only those vertices together.

Another difference that I would like to see is that once the mirror cut tool merges the 2 halfs you lose the "updatability" of the instancing.

So I'm going to try to figure out a way around it.

Mr. Hawk,
I dont have a problem admitting I'm not too familiar with the API, which is part of the point of this excercise. I do know you cant touch Maya's core and that the API is just a layer over the core. So I know I cant do in and rewrite an existing tool, and I dont plan on writing a new polytype, that's just nonsense =)

I do know my fair share of stuff though, and I'm pretty good at figuring stuff out, but I do appreciate your comments so I dont end up hitting the same walls as you did a year ago.

I might go down a similar path as you, with snapping the middle points to the plane. I'll do an offshoot of the mirror cut tool that would allow you to retain the updatability by not combining the 2 meshes, and snapping that middle to the plane, as opposed to using the vertexmerge.

Should work well enough, not EXACTLY what I'm looking for, but definetly a good version .1

thanks again for all the help

-LK

Buexe
04-20-2006, 07:02 AM
Well good luck on your journey. If you are interested in learning the API, may
I suggest David Gould`s fantastic "Complete MAYA Programming"?
It has a lot of very valuable information, you can check the examples on his webpage,
maybe you find something helpful:
www.davidgould.com (http://www.davidgould.com)
cheers
buexe

lkruel
04-20-2006, 12:23 PM
Hmm, good feedback.


I got David Gould's book and I looked over it and it's not going to be as easy as a predefined "instance" function. but it can surely be done.



I got both volumes here, and yeah, it's an awesome book =) Good suggestion

Buexe
04-20-2006, 12:44 PM
ah, okay! :)

CGTalk Moderation
04-20-2006, 12:44 PM
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.