* Fixed problems in with script linking.

I had to update many files to get this to work.
This commit is contained in:
2003-07-27 15:56:32 +00:00
parent 2222fc7168
commit 916f527253
11 changed files with 224 additions and 79 deletions

View File

@@ -583,6 +583,32 @@ int Material_CheckPyObject (PyObject *pyobj)
return (pyobj->ob_type == &Material_Type);
}
/*****************************************************************************/
/* Description: Returns the object with the name specified by the argument */
/* name. Note that the calling function has to remove the first */
/* two characters of the object name. These two characters */
/* specify the type of the object (OB, ME, WO, ...) */
/* The function will return NULL when no object with the given */
/* name is found. */
/*****************************************************************************/
Material * GetMaterialByName (char * name)
{
Material * mat_iter;
mat_iter = G.main->mat.first;
while (mat_iter)
{
if (StringEqual (name, GetIdName (&(mat_iter->id))))
{
return (mat_iter);
}
mat_iter = mat_iter->id.next;
}
/* There is no material with the given name */
return (NULL);
}
/*****************************************************************************/
/* Python BPy_Material methods: */
/*****************************************************************************/