Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
| Show First 20 Lines • Show All 620 Lines • ▼ Show 20 Lines | |||||
| static bool parse_texture_option(const char *&p, | static bool parse_texture_option(const char *&p, | ||||
| const char *end, | const char *end, | ||||
| MTLMaterial *material, | MTLMaterial *material, | ||||
| tex_map_XX &tex_map) | tex_map_XX &tex_map) | ||||
| { | { | ||||
| p = drop_whitespace(p, end); | p = drop_whitespace(p, end); | ||||
| if (parse_keyword(p, end, "-o")) { | if (parse_keyword(p, end, "-o")) { | ||||
| p = parse_floats(p, end, 0.0f, tex_map.translation, 3); | p = parse_floats(p, end, 0.0f, tex_map.translation, 3, true); | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (parse_keyword(p, end, "-s")) { | if (parse_keyword(p, end, "-s")) { | ||||
| p = parse_floats(p, end, 1.0f, tex_map.scale, 3); | p = parse_floats(p, end, 1.0f, tex_map.scale, 3, true); | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (parse_keyword(p, end, "-bm")) { | if (parse_keyword(p, end, "-bm")) { | ||||
| p = parse_float(p, end, 1.0f, material->map_Bump_strength); | p = parse_float(p, end, 1.0f, material->map_Bump_strength, true, true); | ||||
| return true; | return true; | ||||
| } | } | ||||
| if (parse_keyword(p, end, "-type")) { | if (parse_keyword(p, end, "-type")) { | ||||
| p = drop_whitespace(p, end); | p = drop_whitespace(p, end); | ||||
| /* Only sphere is supported. */ | /* Only sphere is supported. */ | ||||
| tex_map.projection_type = SHD_PROJ_SPHERE; | tex_map.projection_type = SHD_PROJ_SPHERE; | ||||
| const StringRef line = StringRef(p, end); | const StringRef line = StringRef(p, end); | ||||
| if (!line.startswith("sphere")) { | if (!line.startswith("sphere")) { | ||||
| ▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines | |||||