GeomAPI_ShapeHierarchy anObjects;
std::list<ResultPtr> aParts;
- std::string theTextureFile;
- if (!FeaturesPlugin_Tools::shapesFromSelectionList(
- anObjectsSelList, isKeepSubShapes, anObjects, aParts, theTextureFile))
+ ResultPtr aTextureSource;
+ if (!FeaturesPlugin_Tools::shapesFromSelectionList
+ (anObjectsSelList, isKeepSubShapes, anObjects, aParts, aTextureSource))
return;
std::shared_ptr<GeomAPI_Dir> aFirstDir, aSecondDir;
ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
aMakeShapeList, *anIt, "Translated");
- aResultBody->setTextureFile(theTextureFile);
+ // Copy image data, if any
+ ModelAPI_Tools::copyImageAttribute(aTextureSource, aResultBody);
setResult(aResultBody, aResultIndex++);
}