Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_Scene.cpp
| Show First 20 Lines • Show All 2,335 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| PyObject *KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | PyObject *KX_Scene::pyattr_get_lights(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | ||||
| { | { | ||||
| KX_Scene* self = static_cast<KX_Scene*>(self_v); | KX_Scene* self = static_cast<KX_Scene*>(self_v); | ||||
| return self->GetLightList()->GetProxy(); | return self->GetLightList()->GetProxy(); | ||||
| } | } | ||||
| PyObject *KX_Scene::pyattr_get_world(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | |||||
| { | |||||
| KX_Scene* self = static_cast<KX_Scene*>(self_v); | |||||
| KX_WorldInfo *world = self->GetWorldInfo(); | |||||
| if (world->GetName() != "") { | |||||
| return world->GetProxy(); | |||||
| } | |||||
| else { | |||||
| Py_RETURN_NONE; | |||||
| } | |||||
| } | |||||
| PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | PyObject *KX_Scene::pyattr_get_cameras(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) | ||||
| { | { | ||||
| /* With refcounts in this case... | /* With refcounts in this case... | ||||
| * the new CListValue is owned by python, so its possible python holds onto it longer then the BGE | * the new CListValue is owned by python, so its possible python holds onto it longer then the BGE | ||||
| * however this is the same with "scene.objects + []", when you make a copy by adding lists. | * however this is the same with "scene.objects + []", when you make a copy by adding lists. | ||||
| */ | */ | ||||
| KX_Scene* self = static_cast<KX_Scene*>(self_v); | KX_Scene* self = static_cast<KX_Scene*>(self_v); | ||||
| ▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| PyAttributeDef KX_Scene::Attributes[] = { | PyAttributeDef KX_Scene::Attributes[] = { | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), | KX_PYATTRIBUTE_RO_FUNCTION("name", KX_Scene, pyattr_get_name), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), | KX_PYATTRIBUTE_RO_FUNCTION("objects", KX_Scene, pyattr_get_objects), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("objectsInactive", KX_Scene, pyattr_get_objects_inactive), | KX_PYATTRIBUTE_RO_FUNCTION("objectsInactive", KX_Scene, pyattr_get_objects_inactive), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), | KX_PYATTRIBUTE_RO_FUNCTION("lights", KX_Scene, pyattr_get_lights), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("cameras", KX_Scene, pyattr_get_cameras), | KX_PYATTRIBUTE_RO_FUNCTION("cameras", KX_Scene, pyattr_get_cameras), | ||||
| KX_PYATTRIBUTE_RO_FUNCTION("world", KX_Scene, pyattr_get_world), | |||||
| KX_PYATTRIBUTE_RW_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera, pyattr_set_active_camera), | KX_PYATTRIBUTE_RW_FUNCTION("active_camera", KX_Scene, pyattr_get_active_camera, pyattr_set_active_camera), | ||||
| KX_PYATTRIBUTE_RW_FUNCTION("pre_draw", KX_Scene, pyattr_get_drawing_callback_pre, pyattr_set_drawing_callback_pre), | KX_PYATTRIBUTE_RW_FUNCTION("pre_draw", KX_Scene, pyattr_get_drawing_callback_pre, pyattr_set_drawing_callback_pre), | ||||
| KX_PYATTRIBUTE_RW_FUNCTION("post_draw", KX_Scene, pyattr_get_drawing_callback_post, pyattr_set_drawing_callback_post), | KX_PYATTRIBUTE_RW_FUNCTION("post_draw", KX_Scene, pyattr_get_drawing_callback_post, pyattr_set_drawing_callback_post), | ||||
| KX_PYATTRIBUTE_RW_FUNCTION("gravity", KX_Scene, pyattr_get_gravity, pyattr_set_gravity), | KX_PYATTRIBUTE_RW_FUNCTION("gravity", KX_Scene, pyattr_get_gravity, pyattr_set_gravity), | ||||
| KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend), | KX_PYATTRIBUTE_BOOL_RO("suspended", KX_Scene, m_suspend), | ||||
| KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), | KX_PYATTRIBUTE_BOOL_RO("activity_culling", KX_Scene, m_activity_culling), | ||||
| KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius), | KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius), | ||||
| KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling), | KX_PYATTRIBUTE_BOOL_RO("dbvt_culling", KX_Scene, m_dbvt_culling), | ||||
| ▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines | |||||