Blender V2.61 - r43446
|
#include <KX_BlenderSceneConverter.h>
Public Types | |
enum | { LIB_LOAD_LOAD_ACTIONS = 1, LIB_LOAD_VERBOSE = 2 } |
Public Member Functions | |
KX_BlenderSceneConverter (Main *maggie, class KX_KetsjiEngine *engine) | |
virtual | ~KX_BlenderSceneConverter () |
virtual void | ConvertScene (class KX_Scene *destinationscene, class RAS_IRenderTools *rendertools, class RAS_ICanvas *canvas) |
virtual void | RemoveScene (class KX_Scene *scene) |
void | SetNewFileName (const STR_String &filename) |
bool | TryAndLoadNewFile () |
void | SetAlwaysUseExpandFraming (bool to_what) |
void | RegisterGameObject (KX_GameObject *gameobject, struct Object *for_blenderobject) |
void | UnregisterGameObject (KX_GameObject *gameobject) |
KX_GameObject * | FindGameObject (struct Object *for_blenderobject) |
void | RegisterGameMesh (RAS_MeshObject *gamemesh, struct Mesh *for_blendermesh) |
RAS_MeshObject * | FindGameMesh (struct Mesh *for_blendermesh) |
void | RegisterPolyMaterial (RAS_IPolyMaterial *polymat) |
void | RegisterBlenderMaterial (BL_Material *mat) |
void | RegisterInterpolatorList (BL_InterpolatorList *actList, struct bAction *for_act) |
BL_InterpolatorList * | FindInterpolatorList (struct bAction *for_act) |
void | RegisterGameActuator (SCA_IActuator *act, struct bActuator *for_actuator) |
SCA_IActuator * | FindGameActuator (struct bActuator *for_actuator) |
void | RegisterGameController (SCA_IController *cont, struct bController *for_controller) |
SCA_IController * | FindGameController (struct bController *for_controller) |
void | RegisterWorldInfo (KX_WorldInfo *worldinfo) |
virtual void | ResetPhysicsObjectsAnimationIpo (bool clearIpo) |
virtual void | resetNoneDynamicObjectToIpo () |
this is for reseting the position,rotation and scale of the gameobjet that is not dynamic | |
virtual void | WritePhysicsObjectToAnimationIpo (int frameNumber) |
this generates ipo curves for position, rotation, allowing to use game physics in animation | |
virtual void | TestHandlesPhysicsObjectToAnimationIpo () |
virtual void | SetMaterials (bool val) |
virtual bool | GetMaterials () |
virtual void | SetGLSLMaterials (bool val) |
virtual bool | GetGLSLMaterials () |
struct Scene * | GetBlenderSceneForName (const STR_String &name) |
struct Main * | GetMainDynamicPath (const char *path) |
vector< struct Main * > & | GetMainDynamic () |
bool | LinkBlendFileMemory (void *data, int length, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options) |
bool | LinkBlendFilePath (const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options) |
bool | LinkBlendFile (struct BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options) |
bool | MergeScene (KX_Scene *to, KX_Scene *from) |
RAS_MeshObject * | ConvertMeshSpecial (KX_Scene *kx_scene, Main *maggie, const char *name) |
bool | FreeBlendFile (struct Main *maggie) |
bool | FreeBlendFile (const char *path) |
void | PrintStats () |
Definition at line 52 of file KX_BlenderSceneConverter.h.
anonymous enum |
Definition at line 179 of file KX_BlenderSceneConverter.h.
KX_BlenderSceneConverter::KX_BlenderSceneConverter | ( | Main * | maggie, |
class KX_KetsjiEngine * | engine | ||
) |
Definition at line 115 of file KX_BlenderSceneConverter.cpp.
References tag_main().
KX_BlenderSceneConverter::~KX_BlenderSceneConverter | ( | ) | [virtual] |
Definition at line 131 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::at(), free_main(), i, main(), and CTR_Map< Key, Value >::size().
RAS_MeshObject * KX_BlenderSceneConverter::ConvertMeshSpecial | ( | KX_Scene * | kx_scene, |
Main * | maggie, | ||
const char * | name | ||
) |
Definition at line 1416 of file KX_BlenderSceneConverter.cpp.
References BL_ConvertMesh(), BLI_addtail(), BLI_findstring(), BLI_remlink(), CTR_Map< Key, Value >::clear(), copy_material(), copy_mesh(), ID::flag, KX_Scene::GetLogicManager(), RAS_MeshObject::GetName(), i, Material::id, LIB_DOIT, Main::mat, Mesh::mat, Main::mesh, Object::mesh, NULL, SCA_LogicManager::RegisterMeshName(), Mesh::totcol, and ID::us.
void KX_BlenderSceneConverter::ConvertScene | ( | class KX_Scene * | destinationscene, |
class RAS_IRenderTools * | rendertools, | ||
class RAS_ICanvas * | canvas | ||
) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 286 of file KX_BlenderSceneConverter.cpp.
References BL_ConvertBlenderObjects(), CTR_Map< Key, Value >::clear(), btIDebugDraw::DBG_DrawAabb, btIDebugDraw::DBG_DrawConstraintLimits, btIDebugDraw::DBG_DrawConstraints, btIDebugDraw::DBG_DrawContactPoints, btIDebugDraw::DBG_DrawText, btIDebugDraw::DBG_DrawWireframe, KX_Scene::GetBlenderScene(), Scene::gm, GameData::mode, GameData::physicsEngine, CcdPhysicsEnvironment::setDeactivationAngularTreshold(), CcdPhysicsEnvironment::setDeactivationLinearTreshold(), CcdPhysicsEnvironment::setDebugDrawer(), CcdPhysicsEnvironment::setDebugMode(), KX_Scene::SetPhysicsEnvironment(), KX_Scene::SetSceneConverter(), SG_SetActiveStage(), SG_STAGE_CONVERTER, SYS_GetCommandLineInt(), SYS_GetSystem(), UseBullet, UseDynamo, UseNone, UseODE, UseSumo, WO_DBVT_CULLING, WOPHY_BULLET, WOPHY_DYNAMO, WOPHY_NONE, WOPHY_ODE, and WOPHY_SUMO.
SCA_IActuator * KX_BlenderSceneConverter::FindGameActuator | ( | struct bActuator * | for_actuator | ) |
Definition at line 601 of file KX_BlenderSceneConverter.cpp.
References NULL.
Referenced by LinkControllerToActuators().
SCA_IController * KX_BlenderSceneConverter::FindGameController | ( | struct bController * | for_controller | ) |
Definition at line 620 of file KX_BlenderSceneConverter.cpp.
References NULL.
Referenced by BL_ConvertSensors().
RAS_MeshObject * KX_BlenderSceneConverter::FindGameMesh | ( | struct Mesh * | for_blendermesh | ) |
Definition at line 548 of file KX_BlenderSceneConverter.cpp.
References NULL.
Referenced by BL_ConvertMesh().
KX_GameObject * KX_BlenderSceneConverter::FindGameObject | ( | struct Object * | for_blenderobject | ) |
Definition at line 528 of file KX_BlenderSceneConverter.cpp.
References NULL.
Referenced by BL_ConvertActuators(), BL_ConvertBlenderObjects(), BL_CreatePhysicsObjectNew(), and BL_ArmatureObject::LoadConstraints().
BL_InterpolatorList * KX_BlenderSceneConverter::FindInterpolatorList | ( | struct bAction * | for_act | ) |
Definition at line 582 of file KX_BlenderSceneConverter.cpp.
References NULL.
Referenced by GetAdtList().
bool KX_BlenderSceneConverter::FreeBlendFile | ( | const char * | path | ) |
Definition at line 1362 of file KX_BlenderSceneConverter.cpp.
References FreeBlendFile(), and GetMainDynamicPath().
bool KX_BlenderSceneConverter::FreeBlendFile | ( | struct Main * | maggie | ) |
Definition at line 1083 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::at(), KX_KetsjiEngine::CurrentScenes(), free_main(), BL_ActionActuator::GetAction(), SCA_LogicManager::GetActionMap(), SCA_IObject::GetActuators(), KX_BlenderMaterial::GetBlenderMaterial(), KX_PolygonMaterial::GetBlenderMaterial(), KX_GameObject::GetBlenderObject(), KX_Scene::GetBlenderScene(), CListValue::GetCount(), RAS_IPolyMaterial::GetFlag(), KX_Scene::GetInactiveList(), KX_Scene::GetLogicManager(), RAS_MeshObject::GetMesh(), KX_GameObject::GetMesh(), KX_GameObject::GetMeshCount(), SCA_LogicManager::GetMeshMap(), KX_GameObject::GetName(), RAS_MeshObject::GetName(), KX_Scene::GetObjectList(), CListValue::GetValue(), KX_Scene::GetWorldInfo(), i, IS_TAGGED, SCA_IActuator::KX_ACT_ACTION, main(), Object::mat, BL_Material::material, Object::mesh, ID::name, NULL, RAS_BLENDERMAT, STR_String::ReadPtr(), CTR_Map< Key, Value >::remove(), KX_GameObject::RemoveMeshes(), KX_Scene::RemoveObject(), RemoveScene(), BL_ActionActuator::SetAction(), CTR_Map< Key, Value >::size(), size(), and tag_main().
Referenced by FreeBlendFile().
Scene * KX_BlenderSceneConverter::GetBlenderSceneForName | ( | const STR_String & | name | ) | [read, virtual] |
Find the specified scene by name, or the first scene if nothing matches (shouldn't happen).
Implements KX_ISceneConverter.
Definition at line 209 of file KX_BlenderSceneConverter.cpp.
References BLI_findstring(), ListBase::first, main(), STR_String::ReadPtr(), and Main::scene.
bool KX_BlenderSceneConverter::GetGLSLMaterials | ( | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 482 of file KX_BlenderSceneConverter.cpp.
Referenced by BL_ConvertMesh(), and gamelight_from_blamp().
vector< Main * > & KX_BlenderSceneConverter::GetMainDynamic | ( | ) |
Definition at line 920 of file KX_BlenderSceneConverter.cpp.
Referenced by LinkBlendFile().
Main * KX_BlenderSceneConverter::GetMainDynamicPath | ( | const char * | path | ) | [read] |
Definition at line 925 of file KX_BlenderSceneConverter.cpp.
References BLI_path_cmp, and NULL.
Referenced by FreeBlendFile(), and LinkBlendFile().
bool KX_BlenderSceneConverter::GetMaterials | ( | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 477 of file KX_BlenderSceneConverter.cpp.
Referenced by BL_ConvertMesh().
bool KX_BlenderSceneConverter::LinkBlendFile | ( | struct BlendHandle * | bpy_openlib, |
const char * | path, | ||
char * | group, | ||
KX_Scene * | scene_merge, | ||
char ** | err_str, | ||
short | options | ||
) |
Definition at line 950 of file KX_BlenderSceneConverter.cpp.
References Main::action, BKE_idcode_from_name(), BKE_reports_clear(), BKE_reports_init(), BL_ConvertMesh(), BLI_linklist_free(), BLO_blendhandle_close(), BLO_blendhandle_get_datablock_names(), BLO_library_append_begin(), BLO_library_append_end(), BLO_library_append_named_part(), KX_KetsjiEngine::CreateScene(), ListBase::first, Object::flag, addon::engine::free(), KX_Scene::GetLogicManager(), GetMainDynamic(), GetMainDynamicPath(), RAS_MeshObject::GetName(), i, ID_AC, ID_ME, ID_SCE, LIB_LOAD_LOAD_ACTIONS, LIB_LOAD_VERBOSE, LinkNode::link, MEM_callocN(), KX_Scene::MergeScene(), Main::mesh, Object::mesh, Main::name, ID::name, names, LinkNode::next, ID::next, NULL, SCA_LogicManager::RegisterActionName(), SCA_LogicManager::RegisterMeshName(), RPT_STORE, and Main::scene.
Referenced by LinkBlendFileMemory(), and LinkBlendFilePath().
bool KX_BlenderSceneConverter::LinkBlendFileMemory | ( | void * | data, |
int | length, | ||
const char * | path, | ||
char * | group, | ||
KX_Scene * | scene_merge, | ||
char ** | err_str, | ||
short | options | ||
) |
Definition at line 934 of file KX_BlenderSceneConverter.cpp.
References BLO_blendhandle_from_memory(), and LinkBlendFile().
bool KX_BlenderSceneConverter::LinkBlendFilePath | ( | const char * | path, |
char * | group, | ||
KX_Scene * | scene_merge, | ||
char ** | err_str, | ||
short | options | ||
) |
Definition at line 942 of file KX_BlenderSceneConverter.cpp.
References BLO_blendhandle_from_file(), LinkBlendFile(), and NULL.
Definition at line 1367 of file KX_BlenderSceneConverter.cpp.
References Object::mat, and RAS_IPolyMaterial::Replace_IScene().
Referenced by KX_Scene::MergeScene().
void KX_BlenderSceneConverter::PrintStats | ( | ) | [inline] |
Definition at line 156 of file KX_BlenderSceneConverter.h.
References MEM_printmemlist_pydict(), and CTR_Map< Key, Value >::size().
void KX_BlenderSceneConverter::RegisterBlenderMaterial | ( | BL_Material * | mat | ) |
Definition at line 487 of file KX_BlenderSceneConverter.cpp.
Referenced by BL_ConvertMesh().
void KX_BlenderSceneConverter::RegisterGameActuator | ( | SCA_IActuator * | act, |
struct bActuator * | for_actuator | ||
) |
Definition at line 592 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by BL_ConvertActuators().
void KX_BlenderSceneConverter::RegisterGameController | ( | SCA_IController * | cont, |
struct bController * | for_controller | ||
) |
Definition at line 611 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by BL_ConvertControllers().
void KX_BlenderSceneConverter::RegisterGameMesh | ( | RAS_MeshObject * | gamemesh, |
struct Mesh * | for_blendermesh | ||
) |
Definition at line 536 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by BL_ConvertMesh().
void KX_BlenderSceneConverter::RegisterGameObject | ( | KX_GameObject * | gameobject, |
struct Object * | for_blenderobject | ||
) |
Definition at line 502 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by bl_ConvertBlenderObject_Single().
void KX_BlenderSceneConverter::RegisterInterpolatorList | ( | BL_InterpolatorList * | actList, |
struct bAction * | for_act | ||
) |
Definition at line 573 of file KX_BlenderSceneConverter.cpp.
References CTR_Map< Key, Value >::insert().
Referenced by GetAdtList().
void KX_BlenderSceneConverter::RegisterPolyMaterial | ( | RAS_IPolyMaterial * | polymat | ) |
Definition at line 566 of file KX_BlenderSceneConverter.cpp.
Referenced by BL_ConvertMesh().
void KX_BlenderSceneConverter::RegisterWorldInfo | ( | KX_WorldInfo * | worldinfo | ) |
Definition at line 630 of file KX_BlenderSceneConverter.cpp.
Referenced by BL_ConvertBlenderObjects().
void KX_BlenderSceneConverter::RemoveScene | ( | class KX_Scene * | scene | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 401 of file KX_BlenderSceneConverter.cpp.
Referenced by FreeBlendFile().
void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo | ( | ) | [virtual] |
this is for reseting the position,rotation and scale of the gameobjet that is not dynamic
Implements KX_ISceneConverter.
Definition at line 706 of file KX_BlenderSceneConverter.cpp.
References KX_ISceneConverter::addInitFromFrame, KX_KetsjiEngine::CurrentScenes(), KX_GameObject::GetBlenderObject(), CListValue::GetCount(), KX_Scene::GetRootParentList(), CListValue::GetValue(), KX_GameObject::IsDynamic(), mat4_to_eul(), KX_GameObject::NodeSetLocalOrientation(), KX_GameObject::NodeSetLocalPosition(), KX_GameObject::NodeSetLocalScale(), KX_GameObject::NodeUpdateGS(), OB_ARMATURE, Object::obmat, Object::size, and Object::type.
void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo | ( | bool | clearIpo | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 636 of file KX_BlenderSceneConverter.cpp.
References IpoCurve::bezt, BLI_remlink(), KX_KetsjiEngine::CurrentScenes(), Ipo::curve, ListBase::first, g, KX_GameObject::GetBlenderObject(), CListValue::GetCount(), KX_Scene::GetRootParentList(), CListValue::GetValue(), i, KX_GameObject::IsDynamic(), MEM_freeN(), IpoCurve::next, and NULL.
void KX_BlenderSceneConverter::SetAlwaysUseExpandFraming | ( | bool | to_what | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 494 of file KX_BlenderSceneConverter.cpp.
void KX_BlenderSceneConverter::SetGLSLMaterials | ( | bool | val | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 471 of file KX_BlenderSceneConverter.cpp.
References simple_enum_gen::val.
void KX_BlenderSceneConverter::SetMaterials | ( | bool | val | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 465 of file KX_BlenderSceneConverter.cpp.
References simple_enum_gen::val.
void KX_BlenderSceneConverter::SetNewFileName | ( | const STR_String & | filename | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 184 of file KX_BlenderSceneConverter.cpp.
void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo | ( | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 871 of file KX_BlenderSceneConverter.cpp.
References KX_KetsjiEngine::CurrentScenes(), Ipo::curve, ListBase::first, g, KX_GameObject::GetBlenderObject(), CListValue::GetCount(), KX_Scene::GetRootParentList(), CListValue::GetValue(), i, and KX_GameObject::IsDynamic().
bool KX_BlenderSceneConverter::TryAndLoadNewFile | ( | ) | [virtual] |
Implements KX_ISceneConverter.
Definition at line 191 of file KX_BlenderSceneConverter.cpp.
void KX_BlenderSceneConverter::UnregisterGameObject | ( | KX_GameObject * | gameobject | ) |
Definition at line 512 of file KX_BlenderSceneConverter.cpp.
References KX_GameObject::GetBlenderObject(), and CTR_Map< Key, Value >::remove().
Referenced by BL_ConvertBlenderObjects(), and KX_Scene::NewRemoveObject().
void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo | ( | int | frameNumber | ) | [virtual] |
this generates ipo curves for position, rotation, allowing to use game physics in animation
Implements KX_ISceneConverter.
Definition at line 751 of file KX_BlenderSceneConverter.cpp.
References Object::adt, BKE_id_add_animdata(), Ipo::blocktype, KX_KetsjiEngine::CurrentScenes(), Ipo::curve, ListBase::first, g, KX_GameObject::GetBlenderObject(), CListValue::GetCount(), KX_Scene::GetObjectList(), MT_Tuple3::getValue(), CListValue::GetValue(), i, Object::id, insert_keyframe(), INSERTKEY_FAST, IpoCurve::ipo, IPO_LIN, KX_GameObject::IsDynamic(), Object::loc, mat3_to_compatible_eul(), KX_GameObject::NodeGetWorldOrientation(), KX_GameObject::NodeGetWorldPosition(), NULL, OB_LOC_X, OB_LOC_Y, OB_LOC_Z, OB_ROT_X, OB_ROT_Y, OB_ROT_Z, Object::parent, Object::rot, MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().