2

This is probably a dumb question, but I can't see what I'm doing wrong.

I want to animate a material (actually the y offset of a procedural texture) according to the value of a shape key that's applied to a different object.

The object with the shape key is shown here:

Shape key properties for object that's animated

The object is "LATTICE_HP_bladder_for_pistoned". This is a lattice modifier for a geometric object. The shape key's value changes as expected when I scrub through my timeline.

When I copy the data path of the shape key's value, I get

key_blocks["Pistoned"].value

So I apply this to the driver I've added to the texture's y offset as follows:

Driver properties

However, nothing happens when I scrub the timeline. The "Value" field never changes from 0.000, even though the shape key is certainly animating correctly in my scene.

What am I doing wrong? Thanks!

Dan Bennett
  • 807
  • 9
  • 20

1 Answers1

2

Please note material drivers can be different than a Scale driver. Sometimes you will need to take this somewhat inconvenient step of adding a driver to datablocks view of the outliner. Get ready for a surprise.

Your material is not shown above.

Select key from the menu ... note the key on panel below.

enter image description here

Note the note from the tooltip from the Lattice Panel which you have already seen. Keys["Key.002"] in my case. Adjust to your case please. So the toolip is showing two items which must be noted. Two Strings.

enter image description here

Tooltip above for reference.

enter image description here

Panel entries. The two pieces of information from the tooltip are entered above.

In Blender User Preferences verify that scripts are enabled. You may want to seek fuller explanations of that concept here at BSE.

You may want to see this link about materials. Driver Expression

enter image description here

atomicbezierslinger
  • 14,279
  • 28
  • 42
  • Thanks, this is helpful... but it's still not working! The tooltip on the shape key value says bpy.data.shape_keys["Key.001"].key_blocks["Pistoned"].value . I have set the driver's prop type to Key, and the prop value to "Key.001" (from the available list). And I have set the Path to "key_blocks["Pistoned"].value . But the value still remains at 0.000 when I scrub the timeline. – Dan Bennett Apr 19 '17 at 17:39
  • It works in my case and I have no magical powers. it will benefit you to be optimistic. Update dependencies button is available. Please Try. I suggest you delete your panel and start again. Clean Slate. These operation take less than 3 minutes. – atomicbezierslinger Apr 19 '17 at 17:46
  • Deleting and recreating the driver did not help. Using the Update Dependencies button did not help. But I noticed that if I move the play head and save the project, then the next time I start Blender and load the project the Value of the driver will be the value of my key at that frame. However, it doesn't change when I scrub the timeline. So it's reading it, but it's not dynamic... – Dan Bennett Apr 19 '17 at 17:54
  • See edit. My time is expiring for a few hours here. – atomicbezierslinger Apr 19 '17 at 17:59
  • 1
    Python scripts are already enabled for auto-run. I have other drivers in my scene which are working OK. So I still have the problem with this driver. – Dan Bennett Apr 19 '17 at 18:02
  • Please use the driver value to animate the X scale of an object ... say some sphere as a different test. I tested against Scale. There may be a difference for some material. Delete ... Copy Data Path and try again. The you might have a slightly different question. – atomicbezierslinger Apr 19 '17 at 18:04
  • X scale works OK. Hmmm. I wonder why it doesn't work for a material. This is the Y Location value of a Mapping node, which is a floating point value, just like my shape key value. – Dan Bennett Apr 19 '17 at 18:10
  • Material drivers can be different. I have some other question here regarding that topic to some degree. You can review them and ask the question such as ... why are Material Drivers invoked differently than Scale Drivers. You have new information. Perhaps a new question is good. My time has expired for a few hours. – atomicbezierslinger Apr 19 '17 at 18:13