MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

StringList property data not saved

4 REPLIES 4
Reply
Message 1 of 5
morten_bohne
320 Views, 4 Replies

StringList property data not saved

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)
4 REPLIES 4
Message 2 of 5
jps
Advocate
in reply to: morten_bohne

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

Message 3 of 5
jps
Advocate
in reply to: jps

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.

Message 4 of 5
morten_bohne
in reply to: jps

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 🙂

Message 5 of 5
jps
Advocate
in reply to: morten_bohne

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...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report