Cycles: fix light strength mistmatch when clicking "use nodes".

Regarding merge status, there should be no build failures, but cycles may not
be enabled in your build, we are still solving:

* Windows: CUDA kernel compile at runtime is failing, probably will have to
  do precompiled kernel again.
* Mac: scons is not building cycles yet.
* Linux doesn't have boost + openimageio libs available in lib/ yet, so it
  requires manual install of those libs still.
This commit is contained in:
Brecht Van Lommel 2011-11-08 22:38:10 +00:00
parent 7f273394d5
commit 46dcad970c
2 changed files with 7 additions and 2 deletions

@ -276,7 +276,6 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated)
vector<Mesh::Triangle> oldtriangle = mesh->triangles;
mesh->clear();
mesh->used_shaders = used_shaders;
mesh->name = ustring(b_ob_data.name().c_str());

@ -665,10 +665,16 @@ void BlenderSync::sync_lamps()
}
else {
ShaderNode *closure, *out;
float strength = 1.0f;
if(b_lamp->type() == BL::Lamp::type_POINT ||
b_lamp->type() == BL::Lamp::type_SPOT ||
b_lamp->type() == BL::Lamp::type_AREA)
strength = 100.0f;
closure = graph->add(new EmissionNode());
closure->input("Color")->value = get_float3(b_lamp->color());
closure->input("Strength")->value.x = b_lamp->energy()*10.0f;
closure->input("Strength")->value.x = strength;
out = graph->output();
graph->connect(closure->output("Emission"), out->input("Surface"));