Scripts

lockAndHide tool – quick Qt UI in Maya

Posted by | Scripts | No Comments

Yesterday I was coding some tools for my students in Python, when I decided it was time to remember what I learnt about Qt some years ago. It was pretty basic stuff, and it was in Softimage, but I thought it wouldn’t be that different in Maya. And it is not that different…

… but I did not want to deal with complicated PyQt code. I just wanted to design my UI in the Qt Designer, connect some signals, read that .ui file in Maya 2014 and make the buttons and checkboxes to run some functions. This is the tool I built: a small interface to be able to lock position, rotation and scale channels.

01_lockHideUI

I searched and read and searched and read, and I found very interesting documentations about it. However, most of them relayed on deeper knowledge about the subject. Do you ever feel like ‘I want to do this and I want to finish it now’, and not waiting for the next day to continue it? In the end, I think I have spent more time trying to find a simpler way rather than learning the hard one. Which is the reason why I’m writing this: so you have more information when you decide to research about the subject.

Read More

MAXScript – Geometry to EditablePoly Modifier

Posted by | Scripts | No Comments

When we want to convert one geometry into another we normally use Morpher, only if they have the same amount of vertices -and the same vertex order. Some time ago I found quite useful to have Edit Poly modifiers on top of that base geometry instead of using Morpher when modelling the different morph targets, mainly because it was easier to toggle them on/off to see the difference from the base object. I have been using this small script during these time, and I thought it could be useful for someone else.

So this is how it works: select one EDIT POLY object, then run the script (you can drag and drop it to a toolbar), then select the ‘target’ object. As I said, as if you were using Morpher :-)

fn geoToEPMod source target =
(
	local theVertCountA
	local posArrayA = #()
	
	local theVertCountB
	local posArrayB = #()
	
	in coordsys local
	(
		if classOf source == Editable_Poly do
		(
			theVertCountA = polyOp.getNumVerts source -- gets how many vertices are
			posArrayA = #()
			for i = 1 to theVertCountA do
			(
				theVertPos = polyOp.getVert source i 
				append posArrayA theVertPos
			)
		)
	)

	in coordsys local
	(
		if classOf source == Editable_Poly do
		(
			theVertCountB = polyOp.getNumVerts target -- gets how many vertices are
			posArrayB = #()
			for i = 1 to theVertCountB do
			(
				theVertPos = polyOp.getVert target i 
				append posArrayB theVertPos
			)
		)
	)

	max modify mode
	addModifier target (Edit_Poly())
	
	toolMode.coordsys #local
	
	for i = 1 to theVertCountA do	
	(
		if (matchPattern (posArrayA[i] as string) pattern:(posArrayB[i] as string)) == false do 
			(				
				mod_verts = #{}					
				append mod_verts i				
				target.modifiers[#Edit_Poly].EditPolyMod.setVert mod_verts posArrayA[i] 
			)
	)	
)

-- execution
if selection[1] != undefined then
(
	if selection.count == 1 then
	(
		if classOf selection[1] == Editable_Poly then
		(
			geoToEPMod (pickObject rubberBand:selection[1].pos rubberBandColor:white) selection[1] 
		)
		else messageBox "Object must be an Editable Poly"
	)		
	else
	(
		messageBox "Please select only one object"
	)
)
else 
(
	messageBox "Please select the target object"
)

MorphConnector 1.0 – Release

Posted by | Scripts | No Comments

*** THIS IS A ‘WORK IN PROGRESS’ VERSION!!! SO USE IT UNDER YOUR OWN RESPONSABILITY!!! ***

 

As you might already know, I code this tool several months ago to assist me when dealing with joysticks and morphs, mainly to speed up the process of setting the expressions on each Morpher track using 3DSMAX. If you do not know it, take a look at this entry.

I decided to give it for free as is because it might be useful for you as well. I changed some parts to make it compatible with Rick Stirling’s joysticks, so with his code and mine you should be ready to build your own facial rig in minutes, although you’ll need to throw in a mesh with some morphs on it. Just execute the script or drag it to a toolbar to make a Macro.

MORPH CONNECTOR 1.0 HERE!

Please let me know if it’s useful for you, if you find a bug… or even if you hate it!

Some facial stuff

Posted by | Rigging, Scripts | No Comments

When working at Kandor we needed some solution for assisting modellers and riggers during the creation of a facial ‘rig’. Doing all the connections by hand between the morph/shapes and the GUI could drive anyone nuts! So after some research I came up with something like the tool shown on the second part of the video. First seconds show the range of motion of Mario’s face:

Not only it helps with connections but also disconnects single channels, single joystick or removes (‘flush’) all the connections from the Morpher modifier.

The tool was inspired by Sami Sorjonen’s work. Take a look at CGMill to see some of his amazing works.

gDeform 0.27

Posted by | Scripts | No Comments

I fixed a little bug in the tool, that make the experience of tweaking quite uncomfortable: now you can change the selection after you apply a morph, and everything will work as it should.

Grab it here!

mental note: I should rewrite this as I have more experience now with scripting…

gDeform 0.25

Posted by | Scripts | One Comment

After a couple of friends told me the tool was not working as expected (thanks, guys!), I decided to give it a go and working a little more on it. Although the tool was focused on animation, I’ve been using it a lot for some skin-fixing on a sequence of  ‘Goleor: the scales and the sword’, which is the project I’m working on.

Now it supports editing several meshes at the same time, and I add a lot of error checkings (something that you learn when someone that is not you uses your tools!), and also I simplified the way it works: one button to do it all.

>>> gDeform_0.25 <<<

INSTRUCTIONS
*** THIS IS A ‘WORK IN PROGRESS’ VERSION!!! SO USE IT UNDER YOUR OWN RESPONSABILITY!!! ***

Read More

gDeform 0.2

Posted by | Scripts | No Comments

After some months of inactivity, I’ve found finally some free hours to continue working on this tool. Some people has asked me to adapt the script to MAX 2010, that comes with new and shiny modeling and tweaking tools. And now I’ve put it into a Macroscript.

So finally here you have it!

gDeform 0.22

Remember that you still need MorphX2, but Kees is so kind he’s still updating the free plugin to the newest MAX versions.

freeDeform

Posted by | Scripts | No Comments

And here it comes another awesome post about deformation tools! A kind folk from Norway, Mads Ringal a.k.a. ‘erazerhead’, has reworked my ‘gDeform’ script a little so it uses Illusion Catalyst instead of LBrush. The main advantage is that the methodology of tweaking the mesh can be achieved now with free tools. Mads has posted a video showing his stuff here:

http://www.vimeo.com/3628532

So don’t forget to grab ‘Illusion Catalyst’ plugins made by Enrico Gullotti for making it work: they are a great tool!

http://www.illusioncatalyst.com

And finally here is the script:

freeDeform

Thanks to Mads for his effort!!!