Panda3D
Loading...
Searching...
No Matches
config_ptloader.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file config_ptloader.cxx
10 * @author drose
11 * @date 2001-04-26
12 */
13
14#include "config_ptloader.h"
15
16// This needs to be included first to work around a bug in OSX 10.4.
17#if defined(HAVE_FCOLLADA) && defined(IS_OSX)
18#include "daeToEggConverter.h"
19#endif
20
22
23#include "config_flt.h"
24#include "fltToEggConverter.h"
25#include "config_lwo.h"
26#include "lwoToEggConverter.h"
27#include "dxfToEggConverter.h"
28#include "vrmlToEggConverter.h"
29#include "objToEggConverter.h"
30#include "eggToObjConverter.h"
31#include "config_xfile.h"
32#include "xFileToEggConverter.h"
33
34// Windows freaks out if this input is placed earlier.
35#if defined(HAVE_FCOLLADA) && !defined(IS_OSX)
36#include "daeToEggConverter.h"
37#endif
38
39#include "dconfig.h"
41#include "eggData.h"
42
43ConfigureDef(config_ptloader);
44NotifyCategoryDef(ptloader, "");
45
46ConfigureFn(config_ptloader) {
48}
49
51("ptloader-units", DU_invalid,
52 PRC_DESC("Specifies the preferred units into which models will be converted "
53 "when using libptloader to automatically convert files to Panda "
54 "at load time, via e.g. \"pview myMayaFile.mb\"."));
55
56ConfigVariableBool ptloader_load_node
57("ptloader-load-node", true,
58 PRC_DESC("Specify true to allow libptloader to invoke the more efficient "
59 "but possibly-experimental code to load model files directly into "
60 "PandaNode when possible. Specify false to force the loading to "
61 "always go through the egg library, which is more likely to be "
62 "reliable."));
63
64/**
65 * Initializes the library. This must be called at least once before any of
66 * the functions or classes in this library can be used. Normally it will be
67 * called by the static initializers and need not be called explicitly, but
68 * special cases exist.
69 */
70void
72 static bool initialized = false;
73 if (initialized) {
74 return;
75 }
76 initialized = true;
77
78 LoaderFileTypePandatool::init_type();
79
81
84
87
90
93
96
100
103 reg->register_type(new LoaderFileTypePandatool(obj_egg, egg_obj));
104
105// #ifdef HAVE_FCOLLADA DAEToEggConverter *dae = new DAEToEggConverter;
106// reg->register_type(new LoaderFileTypePandatool(dae)); #endif
107
108#ifdef HAVE_MAYA
109 // Register the Maya converter as a deferred type. We don't compile it in
110 // directly, because it's big and bulky; we don't need to force people to
111 // load up libmayaloader (and, along with it, all of the Maya API libraries)
112 // until they actually try to load a Maya file.
113 reg->register_deferred_type("mb", "mayaloader");
114 reg->register_deferred_type("ma", "mayaloader");
115#endif
116}
This is a convenience class to specialize ConfigVariable as a boolean type.
This class specializes ConfigVariable as an enumerated type.
This class supervises the construction of an EggData structure from a DXF file.
Convert an obj file to egg data.
This class supervises the construction of an EggData structure from the data represented by the FltHe...
This defines the Loader interface to files whose converters are defined within the Pandatool package ...
This class maintains the set of all known LoaderFileTypes in the universe.
void register_type(LoaderFileType *type)
Defines a new LoaderFileType in the universe.
static LoaderFileTypeRegistry * get_global_ptr()
Returns a pointer to the global LoaderFileTypeRegistry object.
void register_deferred_type(const std::string &extension, const std::string &library)
Records a type associated with a particular extension to be loaded in the future.
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
Convert an Obj file to egg data.
This class supervises the construction of an EggData structure from a VRML file.
void init_libflt()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_liblwo()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libptloader()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libxfile()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.