Supercharging Blender's Drivers with Python

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 16

  • @BrettKromkamp
    @BrettKromkamp Год назад +3

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

    • @CGPython
      @CGPython  Год назад

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

  • @hesido
    @hesido 11 месяцев назад +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  11 месяцев назад

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

    • @hesido
      @hesido 11 месяцев назад

      @@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.

  • @322ss
    @322ss 11 месяцев назад +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  11 месяцев назад +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 11 месяцев назад

      @@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.

  • @A000803323
    @A000803323 2 месяца назад

    Hi! total python noob here. How do I create a script that will add drivers to shape keys for me? I'm trying to control shape keys with empties, but due to the number it would be tedious to add the drivers manually every time (I'm using CC4 characters, which come with a bunch of shape keys, but no way to control them easily unless you buy Iclone). I can't seem to find an answer on google or reddit.

    • @CGPython
      @CGPython  2 месяца назад

      Try this example
      gist.github.com/CGArtPython/d446d51e08f4d6bd277134173d1311e2
      This Blender Python script adds 5 empty objects to the current scene and then assigns drivers to each empty. The drivers are set to control the X location of each empty based on the X location of the next empty in the list, multiplied by 0.5.

  • @abd_3d
    @abd_3d Год назад +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  Год назад +1

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

    • @abd_3d
      @abd_3d Год назад +1

      @@CGPython thank you 😇

  • @ferriohtv
    @ferriohtv Месяц назад

    Master how i can controle timeline Driver whit geometry nodes and python?? would be amazig for make a procedural crows animation

    • @CGPython
      @CGPython  День назад

      Not sure about how to control a timeline from Geo Nodes, but you can create variables and expressions with Python