Is there a way to expose custom attributes?

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
Is there a way to expose custom attributes?

Is there a way to expose the attributes inside an attribute holder,
so that I can verify how to target them with scripts?
showProperties appears to be for some other purpose...


myObject.modifiers[1]
EmptyModifier:Attribute Holder

showProperties myObject.modifiers[1]
false
 
  02 February 2013
I would go with something along the lines of

for def in (custattributes.getDefs myObject.modifiers[1]) do
	print (getPropNames def)
__________________
Scripts :: linkedin
 
  02 February 2013
how about exposing the definitions in the source script -the Parameter block and rollout block, etc?

basically: is there away to select an object that has scripted ca's and see the script itself?

and what about updating the ca?
 
  02 February 2013
Sure there is - the .source property of the def itself, for example (don't feel discouraged and look in the reference, much faster than waiting for reply). Anyway, here's a stupid snippet, changing all integer types to floats:

for def in (custAttributes.getDefs $) do
 	custAttributes.redefine def (substituteString def.source "#integer" "#float")
__________________
Scripts :: linkedin
 
  02 February 2013
beautiful, thank you so much.

I did check the docs, but learn best by example,
and the docs did not make clear (to me) what to portion of the object path I needed to apply .source to.

so I was trying
$.modifiers[1].source


instead of first getting the def itself
and then seeking the def.source
for def in (custAttributes.getDefs $.modifiers[1]) do
 	print def.source
 
  02 February 2013
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 03:08 PM.


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