02/12/2016

BroTools Snippets #03 – PySide context menu for QLineEdit and other elements…

Well, some time ago I decided to go with PySide code for all my UIs instead of native maya.cmds functions for menu-building. I was attracted to the freedom in creating and styling of those menus, and the fact that Jeremy Ernst did a lot of menus with PySide. And another fact that knowing PySide I can not only write UIs for maya, but also for different standalone python tools. Which is cool. But if you just need a menu – go with cmds. Don’t bother with PySide.

Anyway, with that said, I still prefer to use PySide. And recently I was banging my head against the wall, trying to add a simple context menu to QLineEdit. To allow pasting some preset text into QLineEdit, for BroSelector tool.

And Finally, it worked!

Here is the full code related to it. I skip imports and window creation. Just the relevant stuff.

 

#Creating the actual QLineEdit. I use from QtGui import *, so I don't need to write QtGui.QLineEdit, just QLineEdit, mind that.
self.type = QLineEdit("transform")
# Adding context menu to line edit
# Creating action. Make as many as you like
self.actionHello = QAction(self)
self.actionHello.setText("Hello")
self.actionHello.triggered.connect(yourFunctionHere)

# Creating Menu
self.menu = QMenu(self)
# Adding action to menu. Add as many as you like
self.menu.addAction(self.actionHello)

# First we need to change our element's Context Menu Policy to Custom.
self.type.setContextMenuPolicy(Qt.CustomContextMenu)

# Now we catch basically the right-click event, the customContextMenuRequested event, and assing our own handler (function) for it.
self.type.customContextMenuRequested.connect(self.contextMenuRequested)

#And here goes the handler function.
def contextMenuRequested(self, point):
    # the point variable (which you can call whatever you like actually) is passed to this function as first arg, so we can use it in the next line.
    self.menu.exec_(self.type.mapToGlobal(point))

And thats it. YAY! Saving it here, so I won’t lose it, and in case it is useful to someone.



Copied from my site's blog: http://nixes.ru/?p=657

01/12/2016

BroTools Snippets #02

Saving another couple of clicks in routine work, simple script to select joints influencing skinned mesh. Could not find a 1-click solution for this in Maya. Maybe I just missed something? Anyway, maybe this will be useful for someone. Will just leave it here.

It will select joints influencing all shapes of all selected objects.

In a form that can be used in a shelf:

import maya.cmds as cmds
def selectInfluenceJoints (meshes=None):
    if meshes == None:
        meshes = cmds.ls(sl=1)
    if not isinstance(meshes, list):
        meshes = [meshes]
    cmds.select (cl=True)

    for mesh in meshes:
        shapes = cmds.listRelatives(mesh, c=True, s=True)
        for shape in shapes:
            sk = cmds.listConnections(shape, et=True, t='skinCluster')
            if sk != None:
                for s in sk:
                    influences = cmds.skinCluster (s, q=True, inf=True)
                    cmds.select (influences, add=True)
selectInfluenceJoints()


Copied from my site's blog: http://nixes.ru/?p=639

30/11/2016

BroTools Snippets #01

Time to start sharing what little tools and scripts I use in everyday life.

Here’s a multi-exporter I wrote for current project to speed up and stream-line animation exporting process, nothing fancy. It is used to export multiple animated game characters and objects. Responsive object selection list is probably the most fun thing, which inspired me to write another tool, which I will show in the next post.

brotools_multiexporter


Copied from my site's blog: http://nixes.ru/?p=628

11/10/2016

Random animation #01

 

 

Starting some new ‘sections’ of my blog. Under Random animation I will just post some little practice or personal or non-NDA animations I’m working on.



Copied from my site's blog: http://nixes.ru/?p=594

01/09/2016

Maya 2017 switching to PySide2

In order to support Qt 5 Maya 2017 now uses the PySide2 module and shiboken2. While this is supposed to bring a lot of improvements into Maya’s UI, including speed and new functions, it also breaks a lot of old scripts. Including my BroDynamics and other tools. I though about using Qt.py, but that would require me to include it with all my scripts, and really it was too complex for a lot of my tools, especially those shipped as one file.

At first I was a bit terrified, thinking that I’ll have to re-write a lot of code. But in fact I was able to adapt all of my scripts in few minutes.

So, the biggest changes in PySide2 are:
– Some widgets moved from QtGui to QtWidgets
– shiboken is also changed to shiboken2

Before the change I was using PySide like this:

from PySide import QtCore, QtGui
    someWidget = QtGui.QWidget()

The biggest change is to switch to another method of importing PySide:

from PySide.QtCore import *
from PySide.QtGui import *

This way you import all modules directly, and instead of writing QtGui.QWidget you can just use QWidget. Obvious but very handy in this case.

Without any further speculation, here is my final PySide import code.

try:
    from PySide2.QtGui import *
    from PySide2.QtCore import *
    from PySide2.QtWidgets import *
    from shiboken2 import wrapInstance
    print "Using PySide2"
except:
    from PySide.QtGui import *
    from PySide.QtCore import *
    from shiboken import wrapInstance
    print "Using PySide"

And then using simple Replace, available in any text editor, change all “QtGui.” and “QtCore.” to “”. Just remove them.

I will test BroDynamics and other scripts for some time, before making new versions available to the public. Stay tuned :)

Here are a few links you may find useful as well:

Maya Help – PyQt and PySide Widget Best Practices
http://ift.tt/2bLiajj
http://ift.tt/2bGkNFN
http://ift.tt/2bLiajx



Copied from my site's blog: http://nixes.ru/?p=587

20/06/2016

BroDynamics 1.4.0 Released!

Phew, it took me a while to get it all together. It was huge update. Last few days was I was fighting with bugs mostly, which started to appear seemingly out of nowhere.

There are three main updates in this release.
– Added 2 more simulation modes: Points and RBD
– UI Improved

Since there are these huge updates, there may be new bugs in this release, which I did not have a chance to catch yet. Feel free to report any problems you enouncter, and I will try to fix it ASAP.

Along with this release I made new promo video, and started making a series of How To videos.

New Promo

 

 

How To series

 

 

 

 

 

 

I think later I will sit back and write a nice post about some behind-the-scenes… Or not… We’ll see 😀

Changes:
1.4.0
– A lot of bug fixes and improvements overall.
– Compatibility fix! Now works with Maya 2014 too. Probably with 2013 as well.
– UI reworked, now windows delete properly when you close the main BroDynamics window, docked or undocked. Memory leak here and performance impact after closing and openning it often should be fixed now.
– Icons everywhere! 😀
– NEW! Added single object simulation based on nParticles.
– NEW! Rigid Body and Ragdoll simulation module.
– Added SnapRuntime plugin for object matching for RBD mostly. Thank you, Red9.
– Fixed Get button in Batch Window
– Batch window’s list will now properly update when you hit Undo. Now no need to worry about making mistakes there at all.



Copied from my site's blog: http://nixes.ru/?p=568

16/06/2016

BroDynamics Update Sneak Peak

 

 

Working on an update.



Copied from my site's blog: http://nixes.ru/?p=565

05/06/2016

Unity fun

A few weeks ago I was trying out some concepts in Unity, to practice C# and learn some new things. I think it’s time to show some of it here.

Everything in this prototype was done by me, including awesome capsule models for enemies and animations for player character.

Collision-based damage, imploding\exploding grenades, turret spawning, shooting, gravity gun and in later tests even multiplayer support.



Copied from my site's blog: http://nixes.ru/?p=559

04/06/2016

Control Mesh Creator and Auto IK FK Switcher are out!

 

 

Auto IK FK Switcher works with any rig using a regular 3-chain IK-FK setup. It works with meta-connections (fancy name for connecting nodes using ‘message’ connections and finding them later through these connections), which allows it to be context-sensitive. The UI has just a few buttons, and it knows which IK-FK body part you selected, and will perform a switch for selected body-part. You can also freely rename controls and objects, it will still work.

It also has an automatic mode, which will switch IK to FK if you select FK and vice-versa.

Control Mesh Creator replaces control curves with mesh-based controls. They follow the original mesh, and are invisible to the animator, who can simply click on the part of the mesh to select a control. Similar to Pixar’s Presto software approach.



Copied from my site's blog: http://nixes.ru/?p=551

19/05/2016

Site update

Phew, CSS3 is not nearly as hard as I thought some time ago. Updated this site’s design a bit, added some neat hover features, and made the “TOOLS” page where you can take a look at a few of my main tools I made and am using in my work. Some of them are available for purchase, some will be later, some may be free, so keep an eye on that page :)



Copied from my site's blog: http://nixes.ru/?p=489

18/05/2016

BroRig Update 03 – Shape replacer

 

 

And here come Pixar Presto’s style controls! A tool which allows me to quickly replace NURBS curves with controls following mesh. Very intuitive for animators. Thanks to Jason Schleifer for showing how this is done in Maya.



Copied from my site's blog: http://nixes.ru/?p=443

17/05/2016

BroRig Update 02 – Mostly works

Well, it mostly works, and already created a script to replace controls with selectable mesh controls, details in the video.
Will create mini-ui for it, probably, and move onto creation of automatic ik-fk switching stuff… Or fix the rig itself. Or, maybe, put it away for a while, and rig something with advanced skeleton and animate it… Hm, not sure which will be next yet. We’ll see.

 



Copied from my site's blog: http://nixes.ru/?p=431

15/05/2016

BroRig Update 01 – Basic Stretchy IK-FK Done

Hooraaay, Basic stretchy IK-FK is done. Can now quickly rig arms and legs, without feet yet. Scales correctly with the rig, thanks to Zeth Willie’s tutorial. Basically it will correctly scale under any circumstances, even if the character is parented to something else and that other object is scaled. Will try to make everything else scaling the same way.

In the video the character breaks when i’m scaling it just because nothing but legs and arms is rigged. But arms and legs scale correctly. Once I rig spine and head it will work just fine.

Currently it automatically finds 2nd and 3rd joints… But as I think of it now, it was not a good idea. If there are, say, twist joints in that hierarchy, the script wont work. But it’s no biggie, will fix this some other time.

Yeah, also forgot to add, I will, of course, add a nice pretty PySide UI to this!



Copied from my site's blog: http://nixes.ru/?p=427

BroRig Update 00

So, I decided to write my own little auto rigging tool for myself.

 

I’m not sure why I even do this, lets say for usual things:

  • Fun
  • Practice
  • Better understanding of rigging

Yeah, this sounds about right to me.

Goal is: Create my own rigging tool, aimed primarily at joint-based rigs for game dev and cinematics, but extencible enough to be adapted to anything else, with main focus on making rigs produced by it as animation-friendly as possible. Should also be possible to rebuild rigs, hopefully will be able to automate and create presets for characters. It should operate based on the existing skeleton.

I also have a few particular fun ideas and techniques I’d like to implement and use while animating. And for that I will also create tools, which include:

  • Replacing curve controls with invisible mesh controls, overlaying the original mesh. So there are no visual controls, and animator\me can click directly on mesh to select animatable part, Pixar’s Presto-style.
  • The whole tool should work around the existing skeleton, allowing me to take any model with a skeleton and rig it in a matter of a few hours or even minutes.
  • Automatic IK-FK switching, happening at the moment animator selects FK or IK control. Probably through scriptJobs. Since there are no visual nurbs controls to distract an animator, there is no need to hide those when switching too.
  • Fully scalable rig. Since it is mostly meant for gamedev and purely joint based, there won’t be any complex things, so it should be easier to make it fully scalable.

But I still wonder, why not just use AdvancedSkeleton?  Hmm.. Well, I think I’ll still use it for any commercial work, while polishing and testing my rigging tools in my personal practice works. And since I’m trying to write scripts with modular aka OOP approach in mind, I’ll try to make as much of it complatible with AS and other auto-riggers as possible.

So, steps are, not in order:

  • Create functions to work with basic rig hierarchy
  • Create IK-FK rigger, stretchy\squashy. Arms
  • Use IK-FK rigger as a base and adapt it to rig legs
  • Spine, FK, IK, Stretch and squash. Basic for now, don’t want to go too crazy with ribbons and 100500-degree twisting… With modular approach it can be added later, if needed.
  • Simple FK rigger, to rig just FK joints, like fingers, tails, etc.
  • Thanks to my BroDynamics tool, i don’t need to actually build any dynamics into rigs! Yay!
  • Create a tool, which will allow to easily replace any FK curve control with a mesh, and set it up using this or better this technique. Thanks, Jason for showing how to do it. Make it compatible with AdvancedSkeleton.
  • Create a tool, which will allow to quickly add all required scriptJobs for IK-FK switching. Make it compatible with AdvancedSkeleton.

Okay, wish me luck, and here is the first working thing, basic IK-FK setup. In next update will add stretching and pole vector, and wrist rotation to IK control.

 

 



Copied from my site's blog: http://nixes.ru/?p=418

08/05/2016

ShowReel 2016 – Animation and Rigging

New showreel is out!



Copied from my site's blog: http://nixes.ru/?p=413

BroDynamics update 1.1.0

Just a minor heads-up, BroDynamics updated to 1.1.0. Now features collision objects, as well as a few minor fixes.

Also now available on creativecrash.
http://ift.tt/273ADQk



Copied from my site's blog: http://nixes.ru/?p=410

26/04/2016

Celestials

Two videos are now officially available, featuring my work as Lead Animator.
Motion capture on set supervision, mocap data processing, retargeting, polishing, exporing. Some rigging and pipelnie tool development as well.



Copied from my site's blog: http://nixes.ru/?p=393

25/04/2016

BroDynamics is out



Get it on gumroad!
After some time of searching the web for something like good-old Spring Magic for 3ds max, or any other quick and universal secondary-motion solution, I decided to write my own.
It is a part of my own toolkit, which I conveniently called “BroTools” just for the fun of it, but I decided to go further with this prefix and called it BroDynamics.

With a click of a button it can temporary add a simulation dynamics based on nHair to any rig, any selection of objects, bake it on controls, and clean up after itself. Without breaking rigs. Working with referenced rigs.


Recommended use include: Tails, hair, tentacles. It can also be used with any FK hierarchy, which is recommended, but it works with almost any type of hierarchy really. 



So, for example, if you’re an animator who wants to spend more time on creative process and acting of the animation, and less time on routine animator-tasks like creating secondary motion to all those tails, long bunny-ears, tentacles, etc., – this tool is for you.

I’m already using it in my every-day work, so you can expect regular updates, at least for some time.
Currently I plan to add more simulation options to the UI, maybe making it possible to preview the simulation before baking it on controls.


Copied from my site's blog: http://nixes.ru/?p=383