Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_curves.cpp
| Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && (background ? b_mod->show_render() : b_mod->show_viewport())) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| static void set_resolution(BL::Object *b_ob, BL::Scene *scene, BL::SceneLayer *sl, bool render) | static void set_resolution(BL::Object *b_ob, BL::Scene *scene, BL::ViewLayer *sl, bool render) | ||||
| { | { | ||||
| BL::Object::modifiers_iterator b_mod; | BL::Object::modifiers_iterator b_mod; | ||||
| for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) { | for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) { | ||||
| if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) { | if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) { | ||||
| BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr); | BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr); | ||||
| BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); | BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); | ||||
| b_psys.set_resolution(*scene, *sl, *b_ob, (render)? 2: 1); | b_psys.set_resolution(*scene, *sl, *b_ob, (render)? 2: 1); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 570 Lines • ▼ Show 20 Lines | void BlenderSync::sync_curves(Mesh *mesh, | ||||
| const size_t tri_num = mesh->num_triangles(); | const size_t tri_num = mesh->num_triangles(); | ||||
| int used_res = 1; | int used_res = 1; | ||||
| /* extract particle hair data - should be combined with connecting to mesh later*/ | /* extract particle hair data - should be combined with connecting to mesh later*/ | ||||
| ParticleCurveData CData; | ParticleCurveData CData; | ||||
| if(!preview) | if(!preview) | ||||
| set_resolution(&b_ob, &b_scene, &b_scene_layer, true); | set_resolution(&b_ob, &b_scene, &b_view_layer, true); | ||||
| ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview); | ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview); | ||||
| /* add hair geometry to mesh */ | /* add hair geometry to mesh */ | ||||
| if(primitive == CURVE_TRIANGLES) { | if(primitive == CURVE_TRIANGLES) { | ||||
| if(triangle_method == CURVE_CAMERA_TRIANGLES) { | if(triangle_method == CURVE_CAMERA_TRIANGLES) { | ||||
| /* obtain camera parameters */ | /* obtain camera parameters */ | ||||
| float3 RotCam; | float3 RotCam; | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | for(b_mesh.tessface_uv_textures.begin(l); l != b_mesh.tessface_uv_textures.end(); ++l, uv_num++) { | ||||
| uv[i++] = CData.curve_uv[curve]; | uv[i++] = CData.curve_uv[curve]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if(!preview) | if(!preview) | ||||
| set_resolution(&b_ob, &b_scene, &b_scene_layer, false); | set_resolution(&b_ob, &b_scene, &b_view_layer, false); | ||||
| mesh->compute_bounds(); | mesh->compute_bounds(); | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||