diff --git a/code/nel/src/misc/variant.cpp b/code/nel/src/misc/variant.cpp index 0514b2d59..1689775a5 100644 --- a/code/nel/src/misc/variant.cpp +++ b/code/nel/src/misc/variant.cpp @@ -245,6 +245,10 @@ namespace NLMISC void CVariant::fromString( const std::string &s, EVarType t ) { + type = t; + sval = ""; + std::fill( uvalue.vval, uvalue.vval + VARIANT_VVAL_END, 0.0 ); + if( s.empty() ) return; @@ -282,7 +286,6 @@ namespace NLMISC case Vector4: { - std::fill( uvalue.vval, uvalue.vval + VARIANT_VVAL_END, 0.0 ); std::stringstream ss = s; for( int i = 0; i < 4; i++ ) @@ -297,7 +300,6 @@ namespace NLMISC case Matrix4: { - std::fill( uvalue.vval, uvalue.vval + VARIANT_VVAL_END, 0.0 ); std::stringstream ss = s; for( int i = 0; i < 16; i++ ) @@ -310,8 +312,6 @@ namespace NLMISC } } - type = t; - } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp index 33396dabe..69aa154a2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/material_editor/prop_browser_ctrl.cpp @@ -287,6 +287,15 @@ namespace MaterialEditor { QString label = p->propertyName(); std::string value = p->valueText().toUtf8().data(); + + if( v.type() == QVariant::Color ) + { + QColor c = v.value< QColor >(); + value.clear(); + QString val = "%1 %2 %3 %4"; + val = val.arg( c.red() ).arg( c.green() ).arg( c.blue() ).arg( c.alpha() ); + value = val.toUtf8().data(); + } CNelMaterialProxy m = nel3dIface->getMaterial(); CRenderPassProxy pass = m.getPass( currentPass.toUtf8().data() );