Merged 15170:15635 from trunk (no conflicts or even merges)
[blender.git] / source / gameengine / Expressions / Value.cpp
index 56208ab4ad505959f10ae9df9541a16707e0431f..48136eb9dc3e778afacfc5c03898f6f7da36a6d1 100644 (file)
@@ -405,7 +405,20 @@ bool CValue::RemoveProperty(const STR_String & inName)
        return false;
 }
 
        return false;
 }
 
-
+//
+// Get Property Names
+//
+vector<STR_String> CValue::GetPropertyNames()
+{
+       vector<STR_String> result;
+       if(!m_pNamedPropertyArray) return result;
+       for ( std::map<STR_String,CValue*>::iterator it = m_pNamedPropertyArray->begin();
+       !(it == m_pNamedPropertyArray->end());it++)
+       {
+               result.push_back((*it).first);
+       }
+       return result;
+}
 
 //
 // Clear all properties
 
 //
 // Clear all properties
@@ -520,11 +533,6 @@ void CValue::CloneProperties(CValue *replica)
        
 }
 
        
 }
 
-
-
-
-
-
 double*                CValue::GetVector3(bool bGetTransformedVec)
 {
        assertd(false); // don;t get vector from me
 double*                CValue::GetVector3(bool bGetTransformedVec)
 {
        assertd(false); // don;t get vector from me
@@ -775,6 +783,25 @@ int        CValue::_setattr(const STR_String& attr,PyObject* pyobj)
        //PyObjectPlus::_setattr(attr,value);
        return 0;
 };
        //PyObjectPlus::_setattr(attr,value);
        return 0;
 };
+
+PyObject*      CValue::ConvertKeysToPython( void )
+{
+       PyObject *pylist = PyList_New( 0 );
+       PyObject *pystr;
+       
+       if (m_pNamedPropertyArray)
+       {
+               for ( std::map<STR_String,CValue*>::iterator it = m_pNamedPropertyArray->begin();
+               !(it == m_pNamedPropertyArray->end());it++)
+               {
+                       pystr = PyString_FromString( (*it).first );
+                       PyList_Append(pylist, pystr);
+                       Py_DECREF( pystr );
+               }
+       }
+       return pylist;
+}
+
 /*
 PyObject*      CValue::PyMake(PyObject* ignored,PyObject* args)
 {
 /*
 PyObject*      CValue::PyMake(PyObject* ignored,PyObject* args)
 {