Maya 1.0
|
Set of instances along with their frame lists. More...
#include <maya.h>
Public Member Functions | |
MayaGeometryAll () | |
Empty. | |
MayaGeometryAll (const MayaGeometry &) | |
Creates a set of geometries from a unique geometry. More... | |
MayaGeometryAll (const MayaGeometrySet &) | |
Create a set of geometries from a set of geometry. More... | |
MayaGeometryAll (const QVector< MayaGeometrySet > &) | |
Create a set of instances of geometries from a set of geometry. More... | |
MayaGeometryAll (const MayaResources &, const MayaInstanceSet &) | |
Create a complex geometry by combining an atlas and a set of instances. More... | |
MayaGeometryAll (const MayaResources &, const MayaInstanceAll &) | |
Create a complex geometry by combining an atlas and a set of instances. More... | |
~MayaGeometryAll () | |
Empty. | |
void | Append (const MayaGeometry &) |
Add an instance to the scene. More... | |
void | Append (const MayaGeometrySet &) |
Add an instance set to the scene. More... | |
void | Append (const QString &, const FrameScaled &) |
Add an instance to the scene with a given name and frame. | |
void | SetFramesToAll (QVector< FrameScaled >) |
Set the frames to the entire geometry. More... | |
void | SetMaterial (const MayaMaterial &) |
Set the same material for all the objects. More... | |
void | SetMaterial_EqualName (const QString &, const MayaMaterial &) |
Set the material of all the instances whose name exactly matches the given string. More... | |
void | SetMaterial_ContainsName (const QString &n, const MayaMaterial &mo) |
Set the material of all the instances whose name contains the given string. More... | |
MayaGeometry | GetGeometryByName (const QString &n) |
gets the merged geometry of all objects whose name contains the given string. More... | |
void | Rotate (const Vector &) |
Rotate all instances. More... | |
void | Translate (const Vector &) |
Translate all instances. More... | |
void | Scale (const Vector &) |
Scale all instances. More... | |
void | Remove (const QString &) |
Clears one instance given its name. More... | |
void | Clear () |
Clears all instances. | |
void | Append (const MayaGeometryAll &) |
Append a set of instances. More... | |
int | count () const |
Get the number of instances. | |
QList< QString > | GetNames () const |
Get the list of names of the instances in the geometry. | |
MayaGeometrySet & | operator[] (const QString &) |
Get the MayaGeometrySet of the geometry. More... | |
int | GetSetSize () const |
Get the size of instances. | |
Box | GetBox () const |
Return the Bounding Box of each MayaGeometrySet. | |
MayaGeometry | Collapse () const |
Merge all the instances into a single geometry. More... | |
bool | GetMayaGeometrySet (const QString &, MayaGeometrySet &) |
Get one instance given its name. More... | |
bool | GetMayaGeometrySet (const QString &, QVector< MayaGeometrySet > &) |
Get a set of geometrical elements. More... | |
bool | Load_OBJ (const QString &) |
Loads the geometrys from an .obj file into a MayaGeometryAll. Experimental. More... | |
bool | find_MTL_Address (const QString &, const QString &, QString &, QString &) |
Loads the geometrys from an .obj file into a MayaGeometryAll. More... | |
bool | Save_OBJ (const QString &, const bool &=true) const |
Save the geometry as a Maya .obj file (MayaGeometryAll->MayaGeometry). More... | |
bool | Save_OBJ_Collapse (const QString &) const |
Save a single geometry as a Maya .obj file (Collapse the MayaGeomeryAll). More... | |
bool | Save_PBRT (const QString &) const |
Save the geometry as a .pbrt file (MayaGeometryAll->MayaGeometry). More... | |
bool | Save_VUE (const QString &) const |
Save the instances as a Vue python script. More... | |
bool | Save_XML_Instances (const QString &) const |
Save instances positions into an XML file compatible with Mitsuba. More... | |
bool | Save_XML_Object (const QString &, const QString &id) const |
Save instances positions into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated. More... | |
bool | Save_XML_Object (const QString &, const QString &id, const QString &objbasename, const QString &texturepath, const QString &relPath) const |
Save objects into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated, don't export materials (use Save_XML_Materials() in addition) More... | |
bool | Save_XML (const QString &, const Camera &, const QString &instancefilename=QString(""), bool=false, const QString &=QString(""), bool objectonly=false) const |
Save scene into an XML file. More... | |
bool | Save_VueScript (const QString &) const |
Export instances in Vue Software format. More... | |
MayaStatistics | GetStatistics () const |
Compute the statistics of the geometry. More... | |
QString | GetText (int=0, bool=false) const |
Get the text information. More... | |
Static Public Member Functions | |
static MayaGeometryAll | CreateVoxelSurface (const Voxel &) |
Create a set of visible surface patches representing the surface voxel. More... | |
Protected Attributes | |
QMap< QString, MayaGeometrySet > | instances |
Map between the name of the geometric instances and the MayaGeometrySet structure. A map is used instead of an array to speed up instance search given an input name. | |
Friends | |
class | MayaGpuAll |
Set of instances along with their frame lists.
MayaGeometryAll::MayaGeometryAll | ( | const MayaGeometry & | mg | ) |
Creates a set of geometries from a unique geometry.
This function creates a single geometry entry and a unique reference with identity frame.
mg | Input geometry. |
References Append().
MayaGeometryAll::MayaGeometryAll | ( | const MayaGeometrySet & | mgs | ) |
Create a set of geometries from a set of geometry.
mgs | Input set of geometry. |
References Append().
MayaGeometryAll::MayaGeometryAll | ( | const QVector< MayaGeometrySet > & | s | ) |
MayaGeometryAll::MayaGeometryAll | ( | const MayaResources & | atlas, |
const MayaInstanceSet & | mis | ||
) |
Create a complex geometry by combining an atlas and a set of instances.
atlas | The atlas of models. |
mis | The set of instances. |
References Append(), MayaInstanceSet::GetFrameScaleds(), MayaInstance::GetName(), MayaResources::GetRessource(), and SetFramesToAll().
MayaGeometryAll::MayaGeometryAll | ( | const MayaResources & | atlas, |
const MayaInstanceAll & | mia | ||
) |
Create a complex geometry by combining an atlas and a set of instances.
Traverses the set of instances and replace instance by the geometry in the atlas whenever an entry exists.
atlas | The atlas of models. |
mia | Multiple instance object. |
References Append(), MayaInstanceAll::GetFrameScaleds(), MayaResources::GetRessource(), MayaInstanceAll::instances, and SetFramesToAll().
void MayaGeometryAll::Append | ( | const MayaGeometry & | in | ) |
Add an instance to the scene.
This function checks if the object already exists in the collection of models. If it already exists, it simply creates a reference to it, otherwise it creates a new entry.
in | The instance. |
References MayaGeometry::GetName(), FrameScaled::Id, and instances.
Referenced by Append(), and MayaGeometryAll().
void MayaGeometryAll::Append | ( | const MayaGeometryAll & | scene | ) |
void MayaGeometryAll::Append | ( | const MayaGeometrySet & | in | ) |
Add an instance set to the scene.
This function checks if the object already exists in the collection of models. If so, it simply creates a reference to it, otherwise it creates a new entry.
in | The instance. |
References MayaGeometrySet::count(), MayaGeometrySet::GetFrameScaled(), MayaGeometrySet::GetName(), and instances.
MayaGeometry MayaGeometryAll::Collapse | ( | ) | const |
Merge all the instances into a single geometry.
Note that the resulting geometry can be huge if many instances were used.
References instances, and MayaGeometry::Merge().
Referenced by Save_OBJ_Collapse().
|
static |
Create a set of visible surface patches representing the surface voxel.
This function differs from MayaGeometrySet::CreateVoxel(const Voxel&) in the sense that there will be no coplanar faces between neighboring cubes.
voxel | The voxel. |
References MayaInstanceAll::Append(), MayaResources::Append(), Voxel::at(), Array::Cell(), Array::CellSizeX(), Array::CellSizeY(), Array::CellSizeZ(), Box::Center(), MayaGeometryAll(), FrameScaled::Translation(), and Array::UnitCell().
bool MayaGeometryAll::find_MTL_Address | ( | const QString & | url, |
const QString & | name, | ||
QString & | nameR, | ||
QString & | nameA | ||
) |
Loads the geometrys from an .obj file into a MayaGeometryAll.
url | File name (which should contain the extension .obj). / bool MayaGeometryAll::Load_OBJ(const QString& url) { return Load_OBJ(url); //// Clear arrays //int cptV = 0, cptN = 0, cptUV = 0; //QVector<Vector> vertex, normal; //QVector<Vector2> UVmap; //QVector<MayaIndexVertexData> indexes; //QString nameS(""), nameMTLFile(""), nameMTLMat(""), nameFileMat(""), nameFileAlpha(""); |
//// Set of regular expressions //QRegularExpression rex_FMname("mtllib\\s*(\\w*\\.mtl)"); // Material name file //QRegularExpression rex_Oname("o\\s*(\\w+)"); // Object name //QRegularExpression rex_G("g"); // Start group //QRegularExpression rex_Gname("g\\s*(\\w+)"); // Group name //QRegularExpression rex_Mname("usemtl\\s*(\\w*)"); // Material name //QRegularExpression rexv("v\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Vertex //QRegularExpression rexn("vn\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Normals //QRegularExpression rext("vt\\s+([-|+]*\\d+.*\\d*)\\s+([-|+]*\\d+.*\\d*)"); // Texture coordinates //QRegularExpression rex_v("f\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)"); // Triangles with Vertex //QRegularExpression rex_vt("f\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)"); // Triangles with Vertex/texture-coordinate //QRegularExpression rex_vtn("f\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)");// Triangles with Vertex/texture-coordinate/normal //QRegularExpression rex_vn("f\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)"); // Triangles with Vertex/normal
//QRegularExpression rex_v4("f\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)\\s+(\\d*)"); // Quadrangles with Vertex //QRegularExpression rex_vt4("f\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)"); // Quadrangles with Vertex/texture-coordinate //QRegularExpression rex_vtn4("f\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)\\s+(\\d*)/(\\d*)/(\\d*)");// Quadrangles with Vertex/texture-coordinate/normal //QRegularExpression rex_vn4("f\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)\\s+(\\d*)//(\\d*)"); // Quadrangles with Vertex/normal
//QFile data(url); //if (!data.open(QFile::ReadOnly)) { // std::cout << "OBJ File Not Found, url : " << url.toUtf8().data() << std::endl; // return false; //} //QFileInfo data_fi(data); //QString name = data_fi.baseName(); //QString address = data_fi.absolutePath().append("/");
//std::cout << "ERROR OBJ : use File Not Found, url : " << url.toUtf8().data() << std::endl;
//QTextStream in(&data); //// Since cap(0) from the regular expression corresponds to the matching substring //// We need to start with cap(1) to get the matching components // //// TODO QT6 ////while (!in.atEnd()) ////{ //// QString line = in.readLine();
//// // Material name file //// if (rex_FMname.indexIn(line, 0) > -1) { //// nameMTLFile = rex_FMname.cap(1); //// } //// // Material name //// else if (rex_Mname.indexIn(line, 0) > -1) { //// nameMTLMat = rex_Mname.cap(1); //// find_MTL_Address(QString(address + nameMTLFile), nameMTLMat, nameFileMat, nameFileAlpha); //// } //// // Object name //// else if (rex_Oname.indexIn(line, 0) > -1) { //// QString oName = rex_Oname.cap(1); //// } //// // Group name //// else if (rex_Gname.indexIn(line, 0) > -1) { //// nameS = rex_Gname.cap(1); //// } //// // Start group //// else if (rex_G.indexIn(line, 0) > -1) { //// if (indexes.size() > 0) //// { //// MayaGeometry mg; //// QString str(name + nameS.append(QString().setNum(count()))); //// // Create Object //// if (UVmap.size() > 0 && nameFileMat.size() > 0) { //// QImage tex(address + nameFileMat); //// if (tex.isNull()) //// { //// qDebug() << "Errors loading images : " << QString(address + nameFileMat) <<"\n"; //// return false; //// } //// if (nameFileAlpha.size() > 0) { // we have an alpha mask //// QImage alpha(address + nameFileAlpha); //// if (alpha.isNull()) //// { //// qDebug() << "Errors loading alpha channel image : " << QString(address + nameFileAlpha) <<"\n"; //// return false; //// } //// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex,alpha); //// mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); //// } //// else { //// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex); //// mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); //// } ////
//// } //// else if (UVmap.size() > 0) { //// MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); //// mg = MayaGeometry(str, vertex, normal, indexes, mo); //// UVmap.clear(); //// } //// else { //// MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); //// mg = MayaGeometry(str, vertex, normal, indexes, mo); //// }
//// Append(mg);
//// cptV += vertex.size(); //// cptN += normal.size(); //// cptUV += UVmap.size() / 2;
//// if (cptV != cptN || cptV != cptUV) //// std::cout << "Number of vertex != Number of Normal or Number of UV";
//// // New object //// vertex.clear(); //// normal.clear(); //// UVmap.clear(); //// indexes.clear(); //// } //// } //// // Vertex //// else if (rexv.indexIn(line, 0) > -1) //// { //// Vector q = Vector(rexv.cap(1).toDouble(), rexv.cap(2).toDouble(), rexv.cap(3).toDouble()); //// vertex.append(q); //// } //// // Normal //// else if (rexn.indexIn(line, 0) > -1) //// { //// Vector q = Vector(rexn.cap(1).toDouble(), rexn.cap(2).toDouble(), rexn.cap(3).toDouble()); //// normal.append(q); //// } //// // Texture //// else if (rext.indexIn(line, 0) > -1) //// { //// Vector2 q = Vector2(rexn.cap(1).toDouble(), rexn.cap(2).toDouble()); //// UVmap.append(q); //// } //// // Quadrangles : Vertex //// else if (rex_v4.indexIn(line, 0) > -1) {/* Not used / } //// // Quadrangles : Vertex/texture-coordinate //// else if (rex_vt4.indexIn(line, 0) > -1) {/ Not used */ } //// // Quadrangles : Vertex/texture-coordinate/normal //// else if (rex_vtn4.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn4.cap(1).toInt() - 1 - cptV, rex_vtn4.cap(3).toInt() - 1 - cptN, -1, rex_vtn4.cap(2).toInt() - 1 - cptUV); //// MayaIndexVertexData mi2(rex_vtn4.cap(4).toInt() - 1 - cptV, rex_vtn4.cap(6).toInt() - 1 - cptN, -1, rex_vtn4.cap(5).toInt() - 1 - cptUV); //// MayaIndexVertexData mi3(rex_vtn4.cap(7).toInt() - 1 - cptV, rex_vtn4.cap(9).toInt() - 1 - cptN, -1, rex_vtn4.cap(8).toInt() - 1 - cptUV); //// MayaIndexVertexData mi4(rex_vtn4.cap(10).toInt() - 1 - cptV, rex_vtn4.cap(12).toInt() - 1 - cptN, -1, rex_vtn4.cap(11).toInt() - 1 - cptUV);
//// // Triangle1 //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);
//// // Triangle2 //// indexes.append(mi1); //// indexes.append(mi3); //// indexes.append(mi4); //// } //// // Quadrangles : Vertex/normal //// else if (rex_vn4.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(2).toInt() - 1 - cptN); //// MayaIndexVertexData mi2(rex_vtn.cap(3).toInt() - 1 - cptV, rex_vtn.cap(4).toInt() - 1 - cptN); //// MayaIndexVertexData mi3(rex_vtn.cap(5).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN); //// MayaIndexVertexData mi4(rex_vtn.cap(7).toInt() - 1 - cptV, rex_vtn.cap(8).toInt() - 1 - cptN);
//// // Triangle1 //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);
//// // Triangle2 //// indexes.append(mi1); //// indexes.append(mi3); //// indexes.append(mi4); //// } //// // Triangles : Vertex //// else if (rex_v.indexIn(line, 0) > -1) {/* Not used / } //// // Triangles : Vertex/texture-coordinate //// else if (rex_vt.indexIn(line, 0) > -1) {/ Not used */ } //// // Triangles : Vertex/texture-coordinate/normal //// else if (rex_vtn.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(3).toInt() - 1 - cptN, -1, rex_vtn.cap(2).toInt() - 1 - cptUV); //// MayaIndexVertexData mi2(rex_vtn.cap(4).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN, -1, rex_vtn.cap(5).toInt() - 1 - cptUV); //// MayaIndexVertexData mi3(rex_vtn.cap(7).toInt() - 1 - cptV, rex_vtn.cap(9).toInt() - 1 - cptN, -1, rex_vtn.cap(8).toInt() - 1 - cptUV);
//// // Triangle //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3);
//// } //// // Triangles : Vertex/normal //// else if (rex_vn.indexIn(line, 0) > -1) //// { //// MayaIndexVertexData mi1(rex_vtn.cap(1).toInt() - 1 - cptV, rex_vtn.cap(2).toInt() - 1 - cptN); //// MayaIndexVertexData mi2(rex_vtn.cap(3).toInt() - 1 - cptV, rex_vtn.cap(4).toInt() - 1 - cptN); //// MayaIndexVertexData mi3(rex_vtn.cap(5).toInt() - 1 - cptV, rex_vtn.cap(6).toInt() - 1 - cptN);
//// // Triangle //// indexes.append(mi1); //// indexes.append(mi2); //// indexes.append(mi3); //// } ////}
//if (indexes.size() > 0) //{ // MayaGeometry mg; // QString str(name + nameS.append(QString().setNum(count()))); // // Create Object // if (UVmap.size() > 0 && nameFileMat.size() > 0) { // QImage tex(address + nameFileMat); // if (tex.isNull()) // { // qDebug() << "Errors loading images : " << QString(address + nameFileMat) <<"\n"; // return false; // }
// MayaMaterial mo = MayaMaterial(ShaderTextureUV, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50., tex); // mg = MayaGeometry(str, vertex, normal, UVmap, indexes, mo); // } // else if (UVmap.size() > 0) { // MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); // mg = MayaGeometry(str, vertex, normal, indexes, mo); // } // else { // MayaMaterial mo = MayaMaterial(ShaderPhong, Color(0.3, 0.3, 0.3, 1.0), Color(0.5, 0.4, 0.2, 1.0), Color(0.1, 0.1, 0.1, 1.0), 50.0); // mg = MayaGeometry(str, vertex, normal, indexes, mo); // } // //mg.Transform(FrameScaled::FromMaya); // Append(mg); //}
//data.close(); //return true; }
/*!
Loads the geometrys from an .obj file into a MayaGeometryAll.
url | File name (which should contain the extension .obj). |
name | Name of the current material. |
nameR | Texture name of the diffuse map. |
nameA | Texture name of the alpha map. |
Referenced by Load_OBJ().
MayaGeometry MayaGeometryAll::GetGeometryByName | ( | const QString & | n | ) |
gets the merged geometry of all objects whose name contains the given string.
n | String that will be searched and matched with the names. |
References instances, and MayaGeometry::Merge().
bool MayaGeometryAll::GetMayaGeometrySet | ( | const QString & | n, |
MayaGeometrySet & | mgs | ||
) |
Get one instance given its name.
n | Name of the instance. |
mgs | Geometry set. |
References instances.
bool MayaGeometryAll::GetMayaGeometrySet | ( | const QString & | n, |
QVector< MayaGeometrySet > & | mgs | ||
) |
MayaStatistics MayaGeometryAll::GetStatistics | ( | ) | const |
QString MayaGeometryAll::GetText | ( | int | spaces = 0 , |
bool | html = false |
||
) | const |
Get the text information.
spaces | Spacing for indenting the text. |
html | Flag to specify syntax highlighting. |
References instances.
bool MayaGeometryAll::Load_OBJ | ( | const QString & | url | ) |
Loads the geometrys from an .obj file into a MayaGeometryAll. Experimental.
url | File name (which should contain the extension .obj). |
References count(), and find_MTL_Address().
Referenced by MayaResources::Append().
|
inline |
void MayaGeometryAll::Remove | ( | const QString & | n | ) |
void MayaGeometryAll::Rotate | ( | const Vector & | r | ) |
bool MayaGeometryAll::Save_OBJ | ( | const QString & | url, |
const bool & | eraseTexture = true |
||
) | const |
Save the geometry as a Maya .obj file (MayaGeometryAll->MayaGeometry).
url | Filename. |
eraseTexture | Boolean to confirm or not to erase the existing texture. |
References instances, MayaGeometry::Save_OBJ(), and MayaGeometry::SetName().
bool MayaGeometryAll::Save_OBJ_Collapse | ( | const QString & | url | ) | const |
Save a single geometry as a Maya .obj file (Collapse the MayaGeomeryAll).
url | Filename. |
References Collapse(), and MayaGeometry::Save_OBJ().
bool MayaGeometryAll::Save_PBRT | ( | const QString & | url | ) | const |
Save the geometry as a .pbrt file (MayaGeometryAll->MayaGeometry).
url | Filename. |
References instances, MayaGeometry::Save_PBRT(), and MayaGeometry::SetName().
bool MayaGeometryAll::Save_VUE | ( | const QString & | url | ) | const |
Save the instances as a Vue python script.
url | Filename. |
References instances.
bool MayaGeometryAll::Save_VueScript | ( | const QString & | url | ) | const |
bool MayaGeometryAll::Save_XML | ( | const QString & | url, |
const Camera & | camera, | ||
const QString & | instancefilename = QString("") , |
||
bool | use_normals = false , |
||
const QString & | shape = QString("") , |
||
bool | objectonly = false |
||
) | const |
Save scene into an XML file.
The XML format is compatible with Mitsuba.
url | Filename. |
camera | The camera. |
instancefilename | What ? |
use_normals | What ? |
shape | What ? |
References Camera::At(), MayaMaterial::diffuse, Camera::Eye(), instances, and Camera::Up().
bool MayaGeometryAll::Save_XML_Instances | ( | const QString & | url | ) | const |
Save instances positions into an XML file compatible with Mitsuba.
url | Filename. |
References instances.
bool MayaGeometryAll::Save_XML_Object | ( | const QString & | url, |
const QString & | id | ||
) | const |
Save instances positions into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated.
url | Filename. |
References MayaMaterial::diffuse, and instances.
bool MayaGeometryAll::Save_XML_Object | ( | const QString & | url, |
const QString & | id, | ||
const QString & | objbasename, | ||
const QString & | texturepath, | ||
const QString & | relPath | ||
) | const |
Save objects into an XML file compatible with Mitsuba and put it in a shapegroup that can be instanciated, don't export materials (use Save_XML_Materials() in addition)
url | Filename. |
id | identifier of the object |
objbasename | the basename of the object (that shares textures) |
texturepath | the path where all the textures should be stored |
References instances, and MayaMaterial::name.
void MayaGeometryAll::Scale | ( | const Vector & | s | ) |
void MayaGeometryAll::SetFramesToAll | ( | QVector< FrameScaled > | s | ) |
Set the frames to the entire geometry.
s | Set of frames. |
References instances.
Referenced by MayaGeometryAll().
void MayaGeometryAll::SetMaterial | ( | const MayaMaterial & | mo | ) |
void MayaGeometryAll::SetMaterial_ContainsName | ( | const QString & | n, |
const MayaMaterial & | mo | ||
) |
Set the material of all the instances whose name contains the given string.
n | String that will be searched and matched with the names. |
mo | Material. |
References instances.
void MayaGeometryAll::SetMaterial_EqualName | ( | const QString & | n, |
const MayaMaterial & | mo | ||
) |
Set the material of all the instances whose name exactly matches the given string.
n | String that will be searched and matched with the names. |
mo | Material. |
References instances.