|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
|
Hi,
I appear to be getting a name corruption when setting the name of a property e.g.
FBString name = "testname"; HFBProperty prop = GetSelectedProperty();
if ( prop ) {
prop->SetName( name ); }
The name appears to become corrupted, this is not always immediately obvious in the properties pane in MB, however if you go to the custom properties list, the name is total gibberish.
FBProperty stores it’s name via an FBString but exposes a char * interface. So I expect it copies it when assigned, meaning it isn’t a simple case of a shallow string copy. To test this I assigned a heap allocated string yet the corruption still occurs.
Has anyone else hit this (and overcame it)?
|
|
|
|
What MB version you use? I ask because this works fine for me on MB2009:
FBModelList lModels;
FBGetSelectedModels(lModels);
for(int i = 0; i < lModels.GetCount(); i++){
FBProperty* lProperty = lModels[i]->PropertyCreate( "NewProp", kFBPT_double,ANIMATIONNODE_TYPE_NUMBER, true, true );
FBString lName("testname");
lProperty->SetName((char*)lName);
}
Also, are you calling SetName for user properties ?
Cheers
|
|
|
|
Thanks for the reply. Even when I paste your sample code into an otherwise empty plugin (the button click method in ortool_template_tool sample), I still get odd results. In this case the name is either set to the name of the dll or it isn’t changed at all. The result is the same regardless if I create a user or internal property. If it means anything I am using MB 7.5 ext 2.
|
|
|
|
Now I have tested it in MB 7.5 ext2 and after that again in MB 2009...and nothing good to say. I get exactly what you describe :( I had to test it wrong first time, problem shows when I refresh Property Editor (close and open) - sorry for that. Why you need to change property name? Maybe there is other solution to problem you wants to solve with it?
Cheers
|
|
|
|
Thanks for doing the extra tests, I am going to just omit the feature I was planning as the only alternative I can think of is creating a new prop, copying curves etc. and deleting the old one which seems like a higher hack cost than what the feature gives back.
|
|
|
|
One workaround solution would be to clone the property and give it a new name, and then delete the original....
~Kristine
KRISTINE MIDDLEMISS | SENIOR DEVELOPER CONSULTANT
AUTODESK DEVELOPER NETWORK Media & Entertainment
http://www.autodesk.com/joinadn
|
|
|
|
|
|