Modifier Property as Variable

Hello. I am trying to figure out how to change a modifier property by using a variable. For example:

if x == 1 then
(
property = "moveX"
)
else if x == 2 then
(
property = "moveY"
)
selection.unwrap_uvw.property (0.5)

The issue I'm running into is how to concatenate the property variable correctly.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

Use setProperty

In a general case with a regular property access, you'd use setProperty like this:

setProperty (modPanel.getCurrentObject()) propertyName 0.5

If you wanted to get a method by name and call that, you could instead use getProperty and invoke the returned method:

(getProperty (modPanel.getCurrentObject()) methodName) 0.5

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.