← All ideas
  • Published 13 Sep 2019

Create Python Object and Listeners

The idea

  • Create a Python Object
  • Create a Listener (Similar to Maya's "ScriptJob")

Usage

  • Write functions to make rig constrains by code functions
  • write any other scripts needed for the object
  • this would be good to use in rigging so instancing the rig would include the custom code needed (dependency in updating a certain addon to a certain version of blender would be released)
  • the simple script would run and calculate with animation changes

Why not use drivers?

  • Drivers are very disperse in terms of layout (have to inspect a dozen bones manually and their submenus instead of just readding a couple of lines)
  • Drivers sub menus are not very easy to edit compared to simply writing the function you need of the relationship between 2 objects

Bonus Perks

  • It allows for malleability to create custom made constraints

Problems and Solution

  • the access to the API and certain functions could be restricted to avoid performance issues

FTRN10WITCHCMMV.LARGE.jpg

100%

Development Status: Open

Upvote 3 Downvote 0
jeremy6321478
13 Sep 2019

3 Comments

jeremy6321478 Author

Event handlers do not register it. So it is quite unusable. I imagine a better organized Drivers Panel would be way too much to even ask. I asked because well Maya has them and it seems like a basic tool to have, I never thought it could be so problematic ~_~

Josephbburg

* @jeremy6321478 * What do you mean by "Event handlers do not register it" ?

I imagine a better organized Drivers Panel would be way too much to even ask

This is a well known difficulty. So it will be helpful to present a polished UI for this (especially with animation 2020 coming up). But of course, drivers in Blender are nothing like Driven Keys in Maya (you want Action Constraints for that). Drivers are more like expression nodes.

Maybe it would help if you explained what you use listeners for in Maya? If it's something that doesn't have a more Blender-ish solution, then it will clarify what is missing. Or maybe it will have a Blender-ish solution, and the challenge will be making it easy to learn for people that are used to other softwares.

Josephbburg

Event handlers already exist, butthey're a bad idea if a driver can do the same thing- handlers add to the list of things Blender has to check, and it's hard to organize this behavior so that it always works well. You can write custom python scripts to call with drivers, which is a better solution. Here's the documentation for this feature.

It allows for malleability to create custom made constraints

This is, IMO, an anti-feature. constraints need to be fast. They should be managed within Blender. if a constraint is missing in Blender, it's better to add one or at least extend the Python API to make constraints more flexible among themselves (like with node-based rigging). Doing stuff with raw Python is slow, although passing the data back and forth with Python is fast enough in most cases. If performance is critical, I reccomend using Numpy or Ctypes (to hook into a C library) instead of plain ol' Python. Or just modify Blender.