Can I get these dimensions:

Dimensions (bpy.data.objects['Cube'].dimensions)

in a Cycles node, as a vector?

I tried an Attribute node with dimensions[0] as the Name, but this didn't work. I also looked at the Geometry and Object Info nodes, but couldn't find anything that looked promising.

Preferably without Python due to the whole "trusted blendfile" feature.

This would open tons of possibilities for optimizations, such as automatically adjusting the scale of a procedurally generated material (here, the dots are non-square).


1 Answer 1


Well, I can answer part of the question. You can get the values of the dimensions into cycles by using drivers, driving 3 separate Value nodes and using the data path of dimensions[0] as the driving value:

  1. Add a Value node: Add> Input> Value
  2. Right click the value and choose 'Add Driver'.
  3. Change to the graph editor and change to 'Drivers' mode from the header toolbar.
  4. Use the following settings in the Property panel (N) after selecting the channel on the left:

enter image description here

As you already identified the data path you need is dimensions[0] (0, 1, or 2).

This will result in:

enter image description here

(6.399 simply being the X dimension value of my test cube)

Repeat this for the 2 other dimension values and 2 more value nodes.

However, as to how you would combine 3 value nodes into a vector is something I don't know. You could of course drive something other than a 'Value' node using this method if that is more useful.

Edit: As noted by Chebhou, in the comments, as of Blender 2.72 a "Combine XYZ" node exists:

enter image description here

Instead of driving 3 individual 'Value' nodes, you can now drive the x, y and z values of the 'Combine XYZ' node which will result in a vector.

  • $\begingroup$ Never thought of using drivers to get external data, nice! You might be able to make a vector by doing some fancy maths with the object coordinates, but it won't be too simple I think. $\endgroup$
    – Greg Zaal
    Oct 24, 2013 at 11:59
  • $\begingroup$ Pretty nice solution. You could eliminate the Python by changing Scripted Expression to Sum Values. However, this material would just be compatible with a single object, then, right? (by the way, I use the Combine RGB node to create a vector, even though I always feel terrible when I do so, simply because there's no better way) $\endgroup$
    – wchargin
    Oct 24, 2013 at 13:16
  • 1
    $\begingroup$ @RayMairlot you can add the combine XYZ node to your answer since it is available now $\endgroup$
    – Chebhou
    Apr 2, 2015 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .