Permalink
Browse files

liq| as|: add 'assembly'

  • Loading branch information...
1 parent b06a8ec commit 4d9b7b5b4108daa991b92c4a3b16f5c9e57aaa24 yaoyansi committed Jun 17, 2012
Showing with 34 additions and 18 deletions.
  1. +20 −3 2.3.3/src/appleseed/as_renderer.cpp
  2. +1 −0 2.3.3/src/appleseed/as_renderer.h
  3. +13 −15 2.3.3/src/appleseed/build_project.cpp
View
23 2.3.3/src/appleseed/as_renderer.cpp
@@ -34,7 +34,10 @@
#include "log_helper.h"
#include "as_GlobalNodeHelper.h"
-extern void build_project(asf::auto_release_ptr<asr::Project>&);
+extern void build_project(
+ asf::auto_release_ptr<asr::Project> &project,
+ asf::auto_release_ptr<asr::Assembly> &assembly
+);
namespace appleseed
{
@@ -291,7 +294,12 @@ namespace appleseed
asf::auto_release_ptr<asr::Scene> _scene(asr::SceneFactory::create());
// Bind the scene to the project.
project->set_scene(_scene);
- build_project(project);
+ // Create an assembly.
+ current_assembly = asr::AssemblyFactory::create(
+ "assembly",
+ asr::ParamArray());
+
+ build_project(project, current_assembly);
//////////////////////////////////////////////////////////////////////////
_s("//### SCENE BEGIN ###");
@@ -516,7 +524,16 @@ namespace appleseed
void Renderer::cookInstanceGroup()
{
CM_TRACE_FUNC("Renderer::cookInstanceGroup()");
- //todo
+
+ // Create an instance of the assembly and insert it into the scene.
+ project->get_scene()->assembly_instances().insert(
+ asr::AssemblyInstanceFactory::create(
+ "assembly_inst",
+ asr::ParamArray(),
+ *current_assembly,
+ asf::Transformd(asf::Matrix4d::identity())));
+ // Insert the assembly into the scene.
+ project->get_scene()->assemblies().insert(current_assembly);
}
void Renderer::exportLightLinks(
View
1 2.3.3/src/appleseed/as_renderer.h
@@ -275,6 +275,7 @@ namespace appleseed
//std::ofstream& get() { return m_log.get(); }
static liquid::LogMgr m_log;
asf::auto_release_ptr<asr::Project> project;
+ asf::auto_release_ptr<asr::Assembly> current_assembly;
protected:
Renderer(const Renderer&);
View
28 2.3.3/src/appleseed/build_project.cpp
@@ -4,15 +4,13 @@
static const std::string root_path = "E:/dev/Autodesk/maya/myplugin/project/liquid_/dependence/appleseed/appleseed-1.1.0-alpha-12-24-g7ad29e2-win32-vs100-devkit/sample";
-void build_project(asf::auto_release_ptr<asr::Project> &project)
+void build_project(
+ asf::auto_release_ptr<asr::Project> &project,
+ asf::auto_release_ptr<asr::Assembly> &assembly
+)
{
CM_TRACE_FUNC("build_project()");
- // Create an assembly.
- asf::auto_release_ptr<asr::Assembly> assembly(
- asr::AssemblyFactory::create(
- "assembly",
- asr::ParamArray()));
// Create a color called "gray" and insert it into the assembly.
static const float GrayReflectance[] = { 0.5f, 0.5f, 0.5f };
@@ -96,16 +94,16 @@ void build_project(asf::auto_release_ptr<asr::Project> &project)
asf::Matrix4d::translation(asf::Vector3d(0.6, 2.0, 1.0))));
assembly->lights().insert(light);
- // Create an instance of the assembly and insert it into the scene.
- project->get_scene()->assembly_instances().insert(
- asr::AssemblyInstanceFactory::create(
- "assembly_inst",
- asr::ParamArray(),
- *assembly,
- asf::Transformd(asf::Matrix4d::identity())));
+// // Create an instance of the assembly and insert it into the scene.
+// project->get_scene()->assembly_instances().insert(
+// asr::AssemblyInstanceFactory::create(
+// "assembly_inst",
+// asr::ParamArray(),
+// *assembly,
+// asf::Transformd(asf::Matrix4d::identity())));
- // Insert the assembly into the scene.
- project->get_scene()->assemblies().insert(assembly);
+// // Insert the assembly into the scene.
+// project->get_scene()->assemblies().insert(assembly);
// Create a pinhole camera with film dimensions 0.980 x 0.735 in (24.892 x 18.669 mm).
// asf::auto_release_ptr<asr::Camera> _camera(

0 comments on commit 4d9b7b5

Please sign in to comment.