void WavefrontDisplayDevice::write_header(void) {
  fprintf(outfile, "# Wavefront OBJ file export by VMD\n");
  fprintf(outfile, "# \n");
  fprintf(outfile, "# Molecular graphics exported from VMD %s\n", VMDVERSION);
  fprintf(outfile, "# http://www.ks.uiuc.edu/Research/vmd/\n");
  fprintf(outfile, "# \n");

#ifdef VMDGENMTLFILE
  fprintf(mtlfile, "# Wavefront OBJ MTL file export by VMD\n");
  fprintf(mtlfile, "# \n");
  fprintf(mtlfile, "# Molecular graphics exported from VMD %s\n", VMDVERSION);
  fprintf(mtlfile, "# http://www.ks.uiuc.edu/Research/vmd/\n");
  fprintf(mtlfile, "# \n");

  if (mtlfilename) {
    char *shortmtlfilename = NULL;
    shortmtlfilename = stripleadingfilepath(mtlfilename);
    fprintf(outfile, "# Load Material Library paired with this scene:\n");
    fprintf(outfile, "mtllib %s\n", shortmtlfilename);
    free(shortmtlfilename);
  }

  write_material_block();
#endif
}
Esempio n. 2
0
void MayaDisplayDevice::write_header(void) {
  fprintf(outfile, "//Maya ASCII 2010 scene\n");
  fprintf(outfile, "//Codeset: UTF-8\n");
  fprintf(outfile, "requires maya \"2010\";\n");
  fprintf(outfile, "currentUnit -l centimeter -a degree -t film;\n");
  fprintf(outfile, "fileInfo \"application\" \"vmd\";\n");
  fprintf(outfile, "fileInfo \"product\" \"VMD %s\";\n", VMDVERSION);
  fprintf(outfile, "fileInfo \"version\" \"%s\";\n", VMD_ARCH);
 
  write_material_block();

  fprintf(outfile, "// VMD template objects for instancing/copying geometry\n");
  fprintf(outfile, "createNode transform -n \"VMDNurbSphere\";\n");
  // hide the template NURBS Sphere by default
  fprintf(outfile, "  setAttr \".v\" no;\n");

  fprintf(outfile, "createNode nurbsSurface -n \"nurbsSphereShape1\" -p \"VMDNurbSphere\";\n");
  fprintf(outfile, "  setAttr -k off \".v\";\n");
  fprintf(outfile, "  setAttr \".vir\" yes;\n");
  fprintf(outfile, "  setAttr \".vif\" yes;\n");
  fprintf(outfile, "  setAttr \".tw\" yes;\n");
  fprintf(outfile, "  setAttr \".covm[0]\"  0 1 1;\n");
  fprintf(outfile, "  setAttr \".cdvm[0]\"  0 1 1;\n");
  fprintf(outfile, "  setAttr \".dvu\" 0;\n");
  fprintf(outfile, "  setAttr \".dvv\" 0;\n");
  fprintf(outfile, "  setAttr \".cpr\" 3;\n");
  fprintf(outfile, "  setAttr \".cps\" 3;\n");
  fprintf(outfile, "  setAttr \".nufa\" 4.5;\n");
  fprintf(outfile, "  setAttr \".nvfa\" 4.5;\n");

  fprintf(outfile, "createNode makeNurbSphere -n \"makeNurbSphere1\";\n");
  fprintf(outfile, "  setAttr \".ax\" -type \"double3\" 0 1 0;\n");
  fprintf(outfile, "  setAttr \".r\" 1.0;\n");

  fprintf(outfile, "connectAttr \"makeNurbSphere1.os\" \"nurbsSphereShape1.cr\";\n");
  fprintf(outfile, "connectAttr \"|VMDNurbSphere|nurbsSphereShape1.iog\" \":initialShadingGroup.dsm\" -na;\n");

  fprintf(outfile, "// End of template objects\n");
}