7
$\begingroup$

I have an object that I want to make a square array like a 3x3x3 cube. I want be able to change length and count for one axis and have all the other ones follow.

3d array

enter image description here

$\endgroup$
  • 3
    $\begingroup$ What about using drivers? $\endgroup$ – gandalf3 Oct 9 '13 at 16:40
  • $\begingroup$ never used drivers before. not even sure what they do. $\endgroup$ – user320 Oct 9 '13 at 16:41
  • $\begingroup$ A driver is a python expression that gets evaluated, which means it can return values depending on some condition - like what the offset of the first array modifier is. And what it returns is used for the second/third modifier as well. It would basically link the offsets of modifier 2 and 3 to the offset of modifier 1. Not sure how to set it up though :( $\endgroup$ – CoDEmanX Oct 9 '13 at 17:04
8
$\begingroup$

You can do this with Drivers

  1. Right click on the Count of the second modifier and select Add Driver.

    enter image description here

  2. In the header of the Graph editor, change the editor type to Drivers:

    enter image description here

  3. In the Properties region (N) set the variable to Single property, and the object to the object with the array modifier which values you want to copy:

    enter image description here

  4. Right click on the Count of the array modifier you want to make the driver equal to and select Copy Data path:

    enter image description here

  5. In the graph editor, Paste the copied data path in the Path box:

    enter image description here

  6. Set the type to Scripted expression, and put the variable you have created in the Expression box:

    enter image description here

    As mentioned by Wchargin, as an alternative to scripted expression you could use Sum Values or something similar. These will be considered "trusted" by the python security features.

Security

Blender has some python security features that will prevent the execution of scripted expression drivers. You can configure the settings for this in User Preferences > File. (see After updating to Blender 2.68 Driver Scripts are no longer automatically excecuted)

$\endgroup$
  • $\begingroup$ Thanks for the step-by-step guide gandalf3, it now works for me. Why it didn't before was simply that drivers are disabled by default and I missed the note about it (you can turn it on globally in the User Preferences > File > Auto Run Python Scripts. Here's my .blend: pasteall.org/blend/24507 $\endgroup$ – CoDEmanX Oct 9 '13 at 17:51
  • 2
    $\begingroup$ Instead of Scripted Expression just set it to Average Value (or Sum Values, etc.) to avoid the Python problem. RNA paths are considered trusted implicitly. $\endgroup$ – wchargin Nov 5 '13 at 1:34
  • $\begingroup$ @WChargin Good point, added. $\endgroup$ – gandalf3 Nov 5 '13 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy