~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/cycles/blender/blender_sync.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
class Light;
43
43
class Mesh;
44
44
class Object;
 
45
class ParticleSystem;
45
46
class Scene;
46
47
class Shader;
47
48
class ShaderGraph;
49
50
 
50
51
class BlenderSync {
51
52
public:
52
 
        BlenderSync(BL::BlendData b_data, BL::Scene b_scene, Scene *scene_, bool preview_);
 
53
        BlenderSync(BL::RenderEngine b_engine_, BL::BlendData b_data, BL::Scene b_scene, Scene *scene_, bool preview_, Progress &progress_, bool is_cpu_);
53
54
        ~BlenderSync();
54
55
 
55
56
        /* sync */
56
57
        bool sync_recalc();
57
 
        void sync_data(BL::SpaceView3D b_v3d, const char *layer = 0);
 
58
        void sync_data(BL::SpaceView3D b_v3d, BL::Object b_override, const char *layer = 0);
58
59
        void sync_camera(BL::Object b_override, int width, int height);
59
60
        void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
 
61
        int get_layer_samples() { return render_layer.samples; }
60
62
 
61
63
        /* get parameters */
62
64
        static SceneParams get_scene_params(BL::Scene b_scene, bool background);
63
 
        static SessionParams get_session_params(BL::UserPreferences b_userpref, BL::Scene b_scene, bool background);
 
65
        static SessionParams get_session_params(BL::RenderEngine b_engine, BL::UserPreferences b_userpref, BL::Scene b_scene, bool background);
64
66
        static bool get_session_pause(BL::Scene b_scene, bool background);
65
 
        static BufferParams get_buffer_params(BL::Scene b_scene, BL::RegionView3D b_rv3d, int width, int height);
 
67
        static BufferParams get_buffer_params(BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, Camera *cam, int width, int height);
66
68
 
67
69
private:
68
70
        /* sync */
69
 
        void sync_lamps();
70
 
        void sync_materials();
71
 
        void sync_objects(BL::SpaceView3D b_v3d);
 
71
        void sync_lamps(bool update_all);
 
72
        void sync_materials(bool update_all);
 
73
        void sync_objects(BL::SpaceView3D b_v3d, int motion = 0);
 
74
        void sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override);
72
75
        void sync_film();
73
76
        void sync_integrator();
74
77
        void sync_view();
75
 
        void sync_world();
 
78
        void sync_world(bool update_all);
76
79
        void sync_render_layers(BL::SpaceView3D b_v3d, const char *layer);
77
80
        void sync_shaders();
 
81
        void sync_curve_settings();
78
82
 
79
83
        void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
80
 
        Mesh *sync_mesh(BL::Object b_ob, bool holdout, bool object_updated);
81
 
        void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag);
82
 
        void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm);
 
84
        Mesh *sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris);
 
85
        void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool object_updated);
 
86
        Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, int motion, bool hide_tris);
 
87
        void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm);
83
88
        void sync_background_light();
 
89
        void sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion);
 
90
        void sync_camera_motion(BL::Object b_ob, int motion);
 
91
 
 
92
        /* particles */
 
93
        bool sync_dupli_particle(BL::Object b_ob, BL::DupliObject b_dup, Object *object);
84
94
 
85
95
        /* util */
86
96
        void find_shader(BL::ID id, vector<uint>& used_shaders, int default_shader);
87
 
        bool object_is_modified(BL::Object b_ob);
 
97
        bool BKE_object_is_modified(BL::Object b_ob);
88
98
        bool object_is_mesh(BL::Object b_ob);
89
99
        bool object_is_light(BL::Object b_ob);
90
100
 
91
101
        /* variables */
 
102
        BL::RenderEngine b_engine;
92
103
        BL::BlendData b_data;
93
104
        BL::Scene b_scene;
94
105
 
96
107
        id_map<ObjectKey, Object> object_map;
97
108
        id_map<void*, Mesh> mesh_map;
98
109
        id_map<ObjectKey, Light> light_map;
 
110
        id_map<ParticleSystemKey, ParticleSystem> particle_system_map;
99
111
        set<Mesh*> mesh_synced;
100
112
        void *world_map;
101
113
        bool world_recalc;
103
115
        Scene *scene;
104
116
        bool preview;
105
117
        bool experimental;
 
118
        bool is_cpu;
106
119
 
107
120
        struct RenderLayerInfo {
108
121
                RenderLayerInfo()
109
 
                : scene_layer(0), layer(0), holdout_layer(0),
 
122
                : scene_layer(0), layer(0),
 
123
                  holdout_layer(0), exclude_layer(0),
110
124
                  material_override(PointerRNA_NULL),
111
125
                  use_background(true),
112
 
                  use_viewport_visibility(false)
 
126
                  use_viewport_visibility(false),
 
127
                  samples(0)
113
128
                {}
114
129
 
115
130
                string name;
116
131
                uint scene_layer;
117
132
                uint layer;
118
133
                uint holdout_layer;
 
134
                uint exclude_layer;
119
135
                BL::Material material_override;
120
136
                bool use_background;
121
137
                bool use_viewport_visibility;
 
138
                bool use_localview;
 
139
                int samples;
122
140
        } render_layer;
 
141
 
 
142
        Progress &progress;
123
143
};
124
144
 
125
145
CCL_NAMESPACE_END