Supercharging Blender's Drivers with Python

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • Learn how to create powerful Blender drivers using Python code in this tutorial. Understand the concept of drivers and see how they can be connected to Python functions. We will start with a basic example and dive into a more advanced scenario, including adding custom logic with if statements and using optional arguments. Unlock the full potential of Blender animations with Python-based drivers.
    Blender: How to set up Python console output on Linux
    • Blender: How to set up...
    Blender: How to set up Python console output on macOS
    • Blender: How to set up...
    #blender #python #scripting

Komentáře • 11

  • @BrettKromkamp
    @BrettKromkamp Před rokem +3

    Useful tutorial! Definitely something I can see finding a use for at some point.

    • @CGPython
      @CGPython  Před rokem

      Hey Brett,
      Glad you think so!
      Thanks! ❤️

  • @322ss
    @322ss Před 8 měsíci +1

    I was looking for this for a while, google doesn't yield many hits so big thanks! Only annoying thing is the fact that those scripts reside in text editor, which isn't part of a model or rig. Is it possible to store these scripts somehow so that those would "follow" along with object, like custom attributes?

    • @CGPython
      @CGPython  Před 7 měsíci +1

      I'm not aware if you can attach a script to a mesh object.
      You can create a library of custom drivers and add it into a startup file or an add-on that will make the drivers available across your scene, blend files, and Blender app instances.
      You can use this add-on as a template:
      gist.github.com/CGArtPython/77fcd50949af18b580770414912e060f

    • @322ss
      @322ss Před 7 měsíci

      @@CGPythonThanks! I wish they would consider these things more thoroughly / my opinion. For example in 3ds Max, one could have script controller driving object values, and those were part of the object - although UI to create those was horrible. I hate it too that one must instantiate (or whatever the Python term is) property blocks and such into a scene, while Blender file can actually have several scenes. I know add-ons can have add-on prefs that are file level data in some way, but storing data in Blend files and objects in general seems to be very limited, or I simply don't find the info how to do it properly.

  • @hesido
    @hesido Před 8 měsíci +1

    Hi, wonderful tutorial! I downloaded a Calendar widget python addon that will support a few drivers so when user changes the date using the widget, however, the driver value is not updated when the user changes the date (The python addon adds a custom property to the scene, which I read in the driver), I either have to wiggle the driven input or click on update dependencies manually. Is there any way around this?

    • @CGPython
      @CGPython  Před 7 měsíci

      Hey,
      Have you tried this?
      blender.stackexchange.com/a/118431

    • @hesido
      @hesido Před 7 měsíci

      @@CGPython Indeed, this works well for the task at hand! Thanks. Although it's a bit hacky for my taste, it does work. Maybe blender will add a native function for updating drivers in future.

  • @do-b
    @do-b Před rokem +1

    hello sir, is there any way i can use geometry node attributes as a driver input ??? example if "plane" object have any float datatype attribute and i want to use it to control the z-rotation of object "plane.001". how can i do ???

    • @CGPython
      @CGPython  Před rokem +1

      I don't know off the top of my head, but I'll think about it

    • @do-b
      @do-b Před rokem +1

      @@CGPython thank you 😇