MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / getScript

Method getScript

Source/Falcor/Scene/Scene.cpp:4005–4047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4003 }
4004
4005 std::string Scene::getScript(const std::string& sceneVar)
4006 {
4007 std::string c;
4008
4009 // Render settings.
4010 c += ScriptWriter::makeSetProperty(sceneVar, kRenderSettings, mRenderSettings);
4011
4012 // Animations.
4013 if (hasAnimation() && !isAnimated())
4014 {
4015 c += ScriptWriter::makeSetProperty(sceneVar, kAnimated, false);
4016 }
4017 for (size_t i = 0; i < mLights.size(); ++i)
4018 {
4019 const auto& light = mLights[i];
4020 if (light->hasAnimation() && !light->isAnimated())
4021 {
4022 c += ScriptWriter::makeSetProperty(sceneVar + "." + kGetLight + "(" + std::to_string(i) + ").", kAnimated, false);
4023 }
4024 }
4025
4026 // Camera.
4027 if (mSelectedCamera != 0)
4028 {
4029 c += sceneVar + "." + kCamera + " = " + sceneVar + "." + kCameras + "[" + std::to_string(mSelectedCamera) + "]\n";
4030 }
4031 c += getCamera()->getScript(sceneVar + "." + kCamera);
4032
4033 // Camera speed.
4034 c += ScriptWriter::makeSetProperty(sceneVar, kCameraSpeed, mCameraSpeed);
4035
4036 // Viewpoints.
4037 if (hasSavedViewpoints())
4038 {
4039 for (size_t i = 1; i < mViewpoints.size(); i++)
4040 {
4041 auto v = mViewpoints[i];
4042 c += ScriptWriter::makeMemberFunc(sceneVar, kAddViewpoint, v.position, v.target, v.up, v.index);
4043 }
4044 }
4045
4046 return c;
4047 }
4048
4049 void Scene::updateNodeTransform(uint32_t nodeID, const float4x4& transform)
4050 {

Callers

nothing calls this directly

Calls 6

hasSavedViewpointsFunction · 0.85
isAnimatedMethod · 0.80
hasAnimationFunction · 0.70
isAnimatedFunction · 0.70
to_stringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected