ScriptSpot

Forum topic · General Scripting

Modifier Property as Variable

By zpeletz · 2020-04-28

Description

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 (1)

Use setProperty

Swordslayer · 2020-05-07

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