Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Plugin/src/SofaPython3/PythonFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<py::str>(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<std::string>(o) );
std::string s = py::cast<std::string>(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;
}

Expand Down
4 changes: 3 additions & 1 deletion bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down