Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

StringList property data not saved

StringList property data not saved

morten_bohne
Advocate Advocate
604 Views
4 Replies
Message 1 of 5

StringList property data not saved

morten_bohne
Advocate
Advocate

Hey, i'm running into some problems when adding StringList properties to take-nodes:

 

I am able to add the property and set data on it, but when saving the file and opening it again, the data is gone.

It works when i use other property-types (tested with bool-properties)

It also works when i test on a cube with StringList-properties

"""
Creates a box, adds a bool and a string-list properties to box and
take01 and sets data on them. To recreate bug save the file after
running script, reopen it, and notice the take stringList property
doesn't have any data"""

import pyfbsdk


def add_string_list(node):
    str_list = node.PropertyCreate(
        "str_list", pyfbsdk.FBPropertyType.kFBPT_stringlist, "StringList",
        False, True, None)
    enum_list = str_list.GetEnumStringList(True)
    enum_list.Add("hello")
    str_list.NotifyEnumStringListChanged()


def add_bool_property(node):
    bool_prop = node.PropertyCreate(
        "bool_prop", pyfbsdk.FBPropertyType.kFBPT_bool, "bool", False, True,
        None)
    bool_prop.Data = True


def add_properties(node):
    add_string_list(node)
    add_bool_property(node)


cube = pyfbsdk.FBModelCube("my_cube")
cube.Show = True
for take in pyfbsdk.FBSystem().Scene.Takes:
    add_properties(take)
add_properties(cube)
0 Likes
605 Views
4 Replies
Replies (4)
Message 2 of 5

jps
Advocate
Advocate

Is that related to the the option to remove non animated channels at loading/saving ?

0 Likes
Message 3 of 5

jps
Advocate
Advocate

Strange thing is I can add the stringlist using your script, save the file as AQSCII read the ASCII file, the property and string content is there and I can load it without problem.

BUT, if I change the content manually of the list using the UI it doesn't save inside the ASCII file, I still have the old value.

0 Likes
Message 4 of 5

morten_bohne
Advocate
Advocate

Thanks for your reply. I have tested both with the binary and ascii fbx in mobu2019 and mobu2016sp1hf7, and I'm getting the same result every time: The cube has both bool and stringList properties and values, but take01 is missing values in the stringList attribute.

 

Just to rule out any misunderstandings; when you ran the script, saved the file and opened it again, did you have values on the take01 StringList property, not just the cube?

 

I have reported the issue, but for now, my workaround will just be using strings and then splitting them manually when I read the data

 

Thanks again for looking into this 🙂

0 Likes
Message 5 of 5

jps
Advocate
Advocate
I did test again and extended the test to Enum custom properties.

So when I reload the file both string list and enum are empty on the take.
Only the cube retains the content of each prop. It reminds me a bit not so
long ago were any property set to a take wasn't saved at all. So they
might have fix this old bug but partially.

My other concern is what I've explained on the previous message. After
running the scrip, if you manually change the content of the string list,
that change doesn't save in the file. If you edit/read the ASCII file,
the value of the string list is back to what it was defined by the script.
Strange...
0 Likes