diff --git a/Plugin/src/SofaPython3/PythonFactory.cpp b/Plugin/src/SofaPython3/PythonFactory.cpp index e3b98e0a..a0674c4b 100644 --- a/Plugin/src/SofaPython3/PythonFactory.cpp +++ b/Plugin/src/SofaPython3/PythonFactory.cpp @@ -346,11 +346,16 @@ void PythonFactory::fromPython(BaseData* d, const py::object& o) // To smooth the deprecation process we are still allowing it ...but prints a warning. if( !nfo.Text() && py::isinstance(o) ) { - msg_deprecated(d->getOwner()) << "Data field '" << d->getName() << "' is initialized from a string." - << " This behavior was allowed with SofaPython2 but have very poor performance so it is now " - << "deprecated with SofaPython3. Please fix your scene (as this behavior will be removed)." - << PythonEnvironment::getPythonCallingPointString(); - d->read( py::cast(o) ); + std::string s = py::cast(o); + if(s.size() > 1 && s[0] != '@') + { + msg_deprecated(d->getOwner()) << "Data field '" << d->getName() << "' is initialized from a string." << msgendl + << " This behavior was allowed with SofaPython2 but have very poor performance so it is now " + << "deprecated with SofaPython3. Please fix your scene (as this behavior will be removed)." << msgendl + << msgendl + << PythonEnvironment::getPythonCallingPointString(); + } + d->read( s ); return; } diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp index 85deda7f..6bee5700 100644 --- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp +++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp @@ -172,7 +172,9 @@ py::object getObject(Node &n, const std::string &name, const py::kwargs& kwargs) if(kwargs.size()!=0) { msg_deprecated(&n) << "Calling the method getObject() with extra arguments is not supported anymore." - << "To remove this message please refer to the documentation of the getObject method"; + << "To remove this message please refer to the documentation of the getObject method" + << msgendl + << PythonEnvironment::getPythonCallingPointString() ; } BaseObject *object = n.getObject(name);