[dali_1.2.22] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / model3d-view / model3d-view-impl.cpp
index e1e4b6f..9c22982 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -278,7 +278,7 @@ const char* NRMMAP_FRAGMENT_SHADER = MAKE_SHADER(
 using namespace Dali;
 
 Model3dView::Model3dView()
-  : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) )
 {
   mIlluminationType = Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP;
 
@@ -328,6 +328,7 @@ void Model3dView::SetProperty( BaseObject* object, Property::Index index, const
         {
           impl.LoadMaterial();
           impl.CreateMaterial();
+          impl.LoadTextures();
         }
         break;
       }
@@ -427,8 +428,6 @@ Property::Value Model3dView::GetProperty( BaseObject* object, Property::Index in
 
 void Model3dView::OnStageConnection( int depth )
 {
-  Control::OnStageConnection( depth );
-
   CustomActor self = Self();
   self.AddRenderer( mRenderer );
 
@@ -448,6 +447,8 @@ void Model3dView::OnStageConnection( int depth )
     constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) );
     constraint.Apply();
   }
+
+  Control::OnStageConnection( depth );
 }
 
 ///////////////////////////////////////////////////////////
@@ -535,6 +536,7 @@ void Model3dView::CreateGeometry()
     {
       mRenderer.SetGeometry( mMesh );
       mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
+      mRenderer.SetProperty( Renderer::Property::DEPTH_TEST_MODE, DepthTestMode::ON );
     }
   }
 }