Message 1 of 3
struct and Custom atrributes
Not applicable
01-27-2009
11:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I am having a problem, I am trying to create an script that will eventually create a floater that will allow animators to create arbitrary anim ranges and store these ranges as a custom attribute to the rootNode, so this is what I have so far, the problem that i am having is that I want to use a struct instance to store each range as it's been created, then append an array with each struct, so array index x gives us 3 values (name of the range, start frame and end frame) the problem surfaces when I try to define a type for the custom attribute.
some code:
THIS I AM PRELOADING IN STDPLUGS/STDSCRIPTS
then here is my work in progress for the script, (NO FLOATER YET, i AM STILL WORKING OUT THE CUSTOM ATTRIBUTE)
Thanks in advance
some code:
THIS I AM PRELOADING IN STDPLUGS/STDSCRIPTS
struct AnimRangerRange (Rangename, beginframe, endframe)
global defaultAnimRange = AnimRangerRange "Default" 0 100
global bhg_global_anim_ranges_list = #()
append bhg_global_anim_ranges_list defaultAnimRange
then here is my work in progress for the script, (NO FLOATER YET, i AM STILL WORKING OUT THE CUSTOM ATTRIBUTE)
( --begin local scope
animRangerArray = bhg_global_anim_ranges_list
if custAttributes.count rootnode == 0 then --# check to see if any custattributes exist at all, if not, then add the anim ranger attribute and default array.
( -- add attribute and default array
rangerdata = attributes AnimRangerData
(
parameters main rollout:params
(
glbanimranges type:#string --# HERE IS THE PROBLEM, HOW DO i SOLVE IT???
) --end params
rollout params "nodata"
(
)
) --end pathdata
custAttributes.add rootNode rangerdata #unique
rootNode.AnimRangerData.glbanimranges = animRangerArray
) -- # end no attribute found
else --# of course if custom attributes exist, we need to see if ours is one of them
(
) --# end else attributes exist
) -- end local scope
Thanks in advance