diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-22 09:20:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-22 09:20:51 +0400 |
commit | 796988adc91e79e9fcaf1d667e0b6f520d48b58d (patch) | |
tree | 9f79a7f4ee8e5a503f374bd08cb83ed51b34a6ad | |
parent | 9d0334bc74b87fc47e54984e8ede7bea84a5b302 (diff) |
modify the python stub to include __file__ and __name__, also correct odd indent in KX_KetsjiEngine.cpp
-rw-r--r-- | release/scripts/templates/script_stub.py | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 23 |
2 files changed, 13 insertions, 13 deletions
diff --git a/release/scripts/templates/script_stub.py b/release/scripts/templates/script_stub.py index 3b3212892d5..143c7c5104a 100644 --- a/release/scripts/templates/script_stub.py +++ b/release/scripts/templates/script_stub.py @@ -8,4 +8,5 @@ import os filename = "my_script.py" filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename) -exec(compile(open(filepath).read(), filepath, 'exec')) +global_namespace = {"__file__": filepath, "__name__": "__main__"} +exec(compile(open(filepath).read(), filepath, 'exec'), global_namespace) diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 0ab7b9ec9e5..88095d90185 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -534,21 +534,20 @@ bool KX_KetsjiEngine::NextFrame() { double timestep = 1.0/m_ticrate; double framestep = timestep; -// static hidden::Clock sClock; + // static hidden::Clock sClock; -m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true); + m_logger->StartLog(tc_services, m_kxsystem->GetTimeInSeconds(),true); -//float dt = sClock.getTimeMicroseconds() * 0.000001f; -//sClock.reset(); + //float dt = sClock.getTimeMicroseconds() * 0.000001f; + //sClock.reset(); -if (m_bFixedTime) - m_clockTime += timestep; -else -{ - -// m_clockTime += dt; - m_clockTime = m_kxsystem->GetTimeInSeconds(); -} + if (m_bFixedTime) { + m_clockTime += timestep; + } + else { + // m_clockTime += dt; + m_clockTime = m_kxsystem->GetTimeInSeconds(); + } double deltatime = m_clockTime - m_frameTime; if (deltatime<0.f) |