diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-04-06 23:36:37 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-04-06 23:49:27 -0300 |
commit | 74808ac4d9176180dc7ecace99723edab8a73e0e (patch) | |
tree | 065e903073bbdebe864bb6322ca0abc2fca108bb /editor/io_plugins | |
parent | 25d09b92be0f5d86cdee6eada80823cdcc2d42bc (diff) |
New particle system, mostly working, some small features missing.
Diffstat (limited to 'editor/io_plugins')
-rw-r--r-- | editor/io_plugins/editor_scene_import_plugin.cpp | 30 | ||||
-rw-r--r-- | editor/io_plugins/editor_scene_importer_fbxconv.cpp | 24 |
2 files changed, 27 insertions, 27 deletions
diff --git a/editor/io_plugins/editor_scene_import_plugin.cpp b/editor/io_plugins/editor_scene_import_plugin.cpp index 52a554f6d1..1fd7078135 100644 --- a/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/editor/io_plugins/editor_scene_import_plugin.cpp @@ -1408,7 +1408,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag for(List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) { if (E->get().type==Variant::OBJECT || E->get().type==Variant::ARRAY || E->get().type==Variant::DICTIONARY) { - if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) { + if (E->get().type==Variant::OBJECT && res->cast_to<SpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) { Ref<ImageTexture> tex =res->get(E->get().name); if (tex.is_valid()) { @@ -1416,7 +1416,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag image_map.insert(tex,TEXTURE_ROLE_DIFFUSE); } - } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/normal")) { + } else if (E->get().type==Variant::OBJECT && res->cast_to<SpatialMaterial>() && (E->get().name=="textures/normal")) { Ref<ImageTexture> tex =res->get(E->get().name); if (tex.is_valid()) { @@ -1424,7 +1424,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag image_map.insert(tex,TEXTURE_ROLE_NORMALMAP); /* if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY) - res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true); + res->cast_to<SpatialMaterial>()->set_fixed_flag(SpatialMaterial::FLAG_USE_XY_NORMALMAP,true); */ } @@ -1532,12 +1532,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + Ref<SpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { //fm->set_flag(Material::FLAG_UNSHADED,true); //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -1555,18 +1555,18 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedSpatialMaterial> mat = m->surface_get_material(i); + Ref<SpatialMaterial> mat = m->surface_get_material(i); if (!mat.is_valid()) continue; if (p_flags&SCENE_FLAG_DETECT_ALPHA && _teststr(mat->get_name(),"alpha")) { - //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //mat->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); //mat->set_name(_fixstr(mat->get_name(),"alpha")); } if (p_flags&SCENE_FLAG_DETECT_VCOLOR && _teststr(mat->get_name(),"vcol")) { - //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); + //mat->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY,true); //mat->set_name(_fixstr(mat->get_name(),"vcol")); } @@ -1641,12 +1641,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + Ref<SpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { //fm->set_flag(Material::FLAG_UNSHADED,true); //fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); //fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - //fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + //fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -1689,12 +1689,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); + Ref<SpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { fm->set_flag(Material::FLAG_UNSHADED,true); fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); } } }*/ @@ -2062,16 +2062,16 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> for(int i=0;i<mesh->get_surface_count();i++) { - Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i); + Ref<SpatialMaterial> fm = mesh->surface_get_material(i); if (fm.is_valid()) { String name = fm->get_name(); /* if (_teststr(name,"alpha")) { - fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + fm->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA,true); name=_fixstr(name,"alpha"); } if (_teststr(name,"vcol")) { - fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); + fm->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY,true); name=_fixstr(name,"vcol"); }*/ fm->set_name(name); diff --git a/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/editor/io_plugins/editor_scene_importer_fbxconv.cpp index a2fe4a649b..12a88c3eb6 100644 --- a/editor/io_plugins/editor_scene_importer_fbxconv.cpp +++ b/editor/io_plugins/editor_scene_importer_fbxconv.cpp @@ -483,29 +483,29 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) { ERR_CONTINUE(!material.has("id")); String id = _id(material["id"]); - Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); + Ref<SpatialMaterial> mat = memnew( SpatialMaterial ); if (material.has("diffuse")) { - mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"])); + mat->set_parameter(SpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"])); } if (material.has("specular")) { - mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"])); + mat->set_parameter(SpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"])); } if (material.has("emissive")) { - mat->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"])); + mat->set_parameter(SpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"])); } if (material.has("shininess")) { float exp = material["shininess"]; - mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,exp); + mat->set_parameter(SpatialMaterial::PARAM_SPECULAR_EXP,exp); } if (material.has("opacity")) { - Color c = mat->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE); + Color c = mat->get_parameter(SpatialMaterial::PARAM_DIFFUSE); c.a=material["opacity"]; - mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,c); + mat->set_parameter(SpatialMaterial::PARAM_DIFFUSE,c); } @@ -537,15 +537,15 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) { String type=texture["type"]; if (type=="DIFFUSE") - mat->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,tex); + mat->set_texture(SpatialMaterial::PARAM_DIFFUSE,tex); else if (type=="SPECULAR") - mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,tex); + mat->set_texture(SpatialMaterial::PARAM_SPECULAR,tex); else if (type=="SHININESS") - mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR_EXP,tex); + mat->set_texture(SpatialMaterial::PARAM_SPECULAR_EXP,tex); else if (type=="NORMAL") - mat->set_texture(FixedSpatialMaterial::PARAM_NORMAL,tex); + mat->set_texture(SpatialMaterial::PARAM_NORMAL,tex); else if (type=="EMISSIVE") - mat->set_texture(FixedSpatialMaterial::PARAM_EMISSION,tex); + mat->set_texture(SpatialMaterial::PARAM_EMISSION,tex); } } |