Variable Definition Confusion

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
Old 11 November 2011   #1
Variable Definition Confusion

fn updateMods selected property state modClass =
		for s in selected do for m in s.modifiers where classOf m == modClass do
		( = state

property = enabled
list = turbosmoothTool.findModifierObjects turboSmooth
selected = turbosmoothTool.findSelectedObjects list turboSmooth
turbosmoothTool.updateMods selected property enabledCBState turboSmooth

So this is a snippet of the code I'm working on, and I can't figure out how to define property variable to have the right value. Right now it is just making the undefined variable of property into the undefined variable of enabled, solving nothing. What I'm trying to do is get = state to essentially be equal to turbosmooth.enabled = true but in context will run entirely different depending on what variables are sent to the function.

So I need a way to define a variable with the actual executable enabled, or for that matter any property of any potential modifier.
Old 11 November 2011   #2
You could pass the property as a string and then use setProperty.

property = "enabled"

setProperty m property state
Artur Leao | Co-Founder / Project Manager
You can do it! VFX
Porto/Lisbon - Portugal
Old 11 November 2011   #3
Fantastic! That worked perfectly, thank you very much.
Old 11 November 2011   #4
better yet, pass it as a name (#enabled instead of "enabled")
Old 11 November 2011   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 08:53 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.