|
Hi arkeon, I have had some success using the GetIPropertyContainer() so I can verify that it works. I used it a bit differently to you though, see below.
int numProps = child->GetIGameObject()->GetIPropertyContainer()->GetNumberOfProperties();
PropType propType;
for (int i = 0; i < numProps; i++)
{
IGameProperty* prop = child->GetIGameObject()->GetIPropertyContainer()->GetProperty(i);
propType = prop->GetType();
const char* propName;
if (propType == IGAME_STRING_PROP)
{
propName = prop->GetName();
if (strcmp(propName, "guid") == 0)
{
prop->GetPropertyValue(guid, 0); //etc....
etc....
I tested your code and found that the QueryProperty will only work on “known” properties. The “known” properties can be defined in IGameProp.xml. The documentation does mention this but it isn’t actually very clear in my opinion.
Hope this helps.
PS
Here is a sample using the IGameProp.xml file that will work for you as long as you add the “IGameTest” property to one of the objects. ("IGameTest" is already defined as a sample)
IGameProperty* gp = pGameNode->GetIGameObject()->GetIPropertyContainer()->QueryProperty(_T("IGameTest")); float temp = 0;
if(gp) {
gp->GetPropertyValue(temp); }
3DSMax 2012 with subscription advantage pack / Windows 7 Enterprise
|