Friday 27 November 2015

Technical Art - VII

Since I finished working on the model rig I decided to focus more on the scripting side of the module before going back to skinning, as I mentioned few posts ago I am planning to develop an auto model picker tool.

The basic features that I want this tool to have are:
  • Automatic rendering of whatever the user is looking at the moment, so that the user can decide to create pickers for specific parts of the model
  • Possibility to have multiple picker views and being able to swap between them
  • The picker should automatically detect and create a button for each joint and control shape in the scene (discarding those which are not visible in the current view)
  • The user should be able to filter out joints based on name patterns or type

With this in mind, I want to design the tool's code so that it could be expanded in the future to add additional features such as loading/saving picker views and further customization like automatic UI controls to tweak set driven keys and special attributes.

Once I planned the features I started working on the actual UI implementation and this was the final result:


Getting a screenshot from the user view proved to be rather easy: I just needed to use the playblast command and save to a file the results and then subsequently use that image inside the form, transforming each joint from world space to screen space was not as simple but after researching ways to find the view and projection matrices for the current camera I managed to find the screen space position of any object in the scene quite easily.
Once those two matrices are available the screen space position can be easily computed by transforming the world position of an object through the view and projection matrix.

Since one of the long term goals was to have a save and load feature I needed a way to store those two pieces of data within my script, so I made a PickerData class that contains all the information required to transform any object in screen space for that specific user configuration.

The PickerData also contains all the information about spawned buttons and their corresponding object: this is used within the filter function to allow the user to filter out specific joints or control shapes in the scene should that be necessary.


Here's an example of the final script working with my rig:

Friday 20 November 2015

Technical Art - VI

After lots of hours of hard work I finally managed to finish the rig! The most difficult thing I had to think about was creating two separate chains of hierarchy: one for the offset groups and control shapes and one for the actual joints; since those two are blended together as everything has to be controlled by the master controller I struggled in my first steps and managed to break the skeleton hierarchy more than once by wrongly parenting control shapes directly to joints rather than using constraint to control them.
But once I finally understood the whole concept of parenting I feel more confident in building basic human rigs and venturing forward to more complex ones.
The missing piece which I wasn't quite grasping was the concept of constraints, so I did research more tutorials and documentation about them and I found some interesting types of constraints which are not strictly related to rigging but could definitely help during animation: one of the was the normal constraint which enables the user to orient a node to the normal of a surface; this would make animating an object sliding through a curved surface quite easy, which made me realize how powerful some of these tools can be if used properly!

For reference here's a screenshot of my final rig:

Screenshot of completed level


I might still decide to add some small things along the way, for example I haven't explored set driven keys for hands but since they won't affect the skinning process I will consider adding them later on.