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.
-
3$\begingroup$ What about using drivers? $\endgroup$– gandalf3 ♦Oct 9, 2013 at 16:40
-
$\begingroup$ never used drivers before. not even sure what they do. $\endgroup$– user320Oct 9, 2013 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$– CodeManXOct 9, 2013 at 17:04
1 Answer
You can do this with Drivers
Right click on the Count of the second modifier and select Add Driver.
In the header of the Graph editor, change the editor type to Drivers:
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:
Right click on the Count of the array modifier you want to make the driver equal to and select Copy Data path:
In the graph editor, Paste the copied data path in the Path box:
Set the type to Scripted expression, and put the variable you have created in the Expression box:
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)
-
$\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$– CodeManXOct 9, 2013 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$– wcharginNov 5, 2013 at 1:34
-