Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/util.h
| Show First 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | static inline string image_user_file_path(BL::ImageUser &iuser, | ||||
| char filepath[1024]; | char filepath[1024]; | ||||
| iuser.tile(0); | iuser.tile(0); | ||||
| BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra); | BKE_image_user_frame_calc(ima.ptr.data, iuser.ptr.data, cfra); | ||||
| BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath); | BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath); | ||||
| string filepath_str = string(filepath); | string filepath_str = string(filepath); | ||||
| if (load_tiled && ima.source() == BL::Image::source_TILED) { | if (load_tiled && ima.source() == BL::Image::source_TILED) { | ||||
| string udim; | string udim; | ||||
| if (ima.tiles.length() > 0) { | if (!ima.tiles.empty()) { | ||||
| udim = to_string(ima.tiles[0].number()); | udim = to_string(ima.tiles[0].number()); | ||||
| } | } | ||||
| string_replace(filepath_str, udim, "<UDIM>"); | string_replace(filepath_str, udim, "<UDIM>"); | ||||
| } | } | ||||
| return filepath_str; | return filepath_str; | ||||
| } | } | ||||
| static inline int image_user_frame_number(BL::ImageUser &iuser, BL::Image &ima, int cfra) | static inline int image_user_frame_number(BL::ImageUser &iuser, BL::Image &ima, int cfra) | ||||
| ▲ Show 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob, | static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob, | ||||
| bool preview, | bool preview, | ||||
| bool experimental) | bool experimental) | ||||
| { | { | ||||
| PointerRNA cobj = RNA_pointer_get(&b_ob.ptr, "cycles"); | PointerRNA cobj = RNA_pointer_get(&b_ob.ptr, "cycles"); | ||||
| if (cobj.data && b_ob.modifiers.length() > 0 && experimental) { | if (cobj.data && !b_ob.modifiers.empty() && experimental) { | ||||
| BL::Modifier mod = b_ob.modifiers[b_ob.modifiers.length() - 1]; | BL::Modifier mod = b_ob.modifiers[b_ob.modifiers.length() - 1]; | ||||
| bool enabled = preview ? mod.show_viewport() : mod.show_render(); | bool enabled = preview ? mod.show_viewport() : mod.show_render(); | ||||
| if (enabled && mod.type() == BL::Modifier::type_SUBSURF && | if (enabled && mod.type() == BL::Modifier::type_SUBSURF && | ||||
| RNA_boolean_get(&cobj, "use_adaptive_subdivision")) { | RNA_boolean_get(&cobj, "use_adaptive_subdivision")) { | ||||
| BL::SubsurfModifier subsurf(mod); | BL::SubsurfModifier subsurf(mod); | ||||
| if (subsurf.subdivision_type() == BL::SubsurfModifier::subdivision_type_CATMULL_CLARK) { | if (subsurf.subdivision_type() == BL::SubsurfModifier::subdivision_type_CATMULL_CLARK) { | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||