Using variables/parameters as numeric values

I’m pretty new to Blender, but I have years of experience using parametric solid/surface modelers (solidworks and its kin). One of the fundamental features of parametric modelers is that wherever you can enter a number, you can enter a variable/parameter (or a function). Obviously Blender isn’t a parametric modeler, but it is very scriptable. Is there a way to set variable names and values and enter them into number fields? I’m assuming this is something that can be done using python, but it’s such a simple thing (programmatically) that I was wondering if there was a way to do it without scripting. Entering anything but a number into number fields gets rejected (the value returns to the last number), which I’m taking as a sign that this isn’t an inherent part of the software.

Here are some examples of where I think this would be useful (this might be superfluous information in which case ignore it):

  1. Setting subdivision modifier values. When I’m working on a particular asset I’d set the “view” value to 3, but when it’s a large scene I’d like to be able to set all the “view” values in that model to 2 or 1. When doing a quick render with a lot of geometry I’d set the “render” value to 3, but when doing the final high-resolution render I’d like to modify it to 4.
  2. Emission strength values. It would be useful to select a group of emission surfaces and adjust their strength in one go. This is where function or math operation would be useful – like multiplying all the values by 2.
  3. Color hex values. Being able to change 1 single color within all the materials, including (and especially) the ones with complex node setups. This would allow you to setup a color palette and swap all the values to different color schemes very quickly. I’m guessing that since the node editor is so powerful this can already be done somehow though…
  4. Connecting scale/rotation values. Changing the scale/rotation value of one object will change the rotation value of a group of objects, each individually.
  5. Changing any modifier value, like changing the displacement strength modifier to, or by, a certain number across several objects.

Any help would be appreciated.

  1. In properties, in the ‘Scene’ tab, at the bottom there is an area called 'simplify. You can set a global maximum for subdivision levels for quick test renders.
    1a) You can do super fast renders without materials, the render menu at the very top, ‘opengl render’

2 & 3. Probably your best bet is node groups. You can take any node setup, be it a single node, or a complex setup and turn them into a node group. This group can be used like a black box in any material. Super simple case, in the node editor. Add, input, value. Change the value to .75. with that value node selected hit ctrl-G to turn it into a node group. the group will expand and show inputs (none) and outputs (the value) Press tab to collapse. Name the group. Now you can plug that node group into the strength of an emission shader, or if you like a mix factor (or anything that will accept a number). In another totally separate material, you can add that node group, Add -> group and select what you named it. When you tab into it and change the value, both materials get changed to reflect the “variable”. The same could be done with an rgb value for sharing a color across materials.

  1. Constraints. Click on any object, properties, contraints (the chain) you can copy the rotation of any other object the scale and a whole lot more.

  2. Is a bit more hacky, and to my knowledge there are a few roads to go down depending on what the ultimate goal is. Maybe eloborate a bit more about the effect you want here.

Thanks, this points me in the right direction. It seems that a combination of drivers, constraints, and node groups will allow me to do most of what I had in mind. In the “Drivers” wiki page there are “User Variables, Single Property” which appear to be almost exactly like global variables (“This can be anything from the intensity of a lamp, to the color of a texture”), though I’m still figuring out how to use them.

This may just be me looking for a one-to-one equivalent of what I’m used to, which is a spreadsheet-like table with variable names and values. It seems to me to be a simple, straightforward, and easy-to-program feature, especially since drivers appear to do far more complicated things, and constraints allow you to link object properties very easily (which internally is just using the same parameter multiplied by the “influence” value). I just need to get used to how this is done in Blender.

And blenderallday – thanks for pointing me to “scene/simplify”, I’ve been looking for something like that for a while but didn’t know how to articulate what I wanted. Huge timesaver!