mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
first pass at (so far useless) mayapview plugin
This commit is contained in:
parent
082be720ce
commit
fa9028eec6
@ -66,3 +66,33 @@
|
||||
mayaCopy.cxx mayaCopy.h
|
||||
|
||||
#end bin_target
|
||||
|
||||
|
||||
#begin lib_target
|
||||
#define USE_PACKAGES maya
|
||||
#define TARGET mayapview
|
||||
#define LOCAL_LIBS mayaegg maya
|
||||
#define OTHER_LIBS \
|
||||
egg:c pandaegg:m \
|
||||
framework:m \
|
||||
linmath:c putil:c panda:m \
|
||||
express:c pandaexpress:m \
|
||||
dtoolutil:c dtoolbase:c dconfig:c dtoolconfig:m dtool:m pystub
|
||||
|
||||
#define UNIX_SYS_LIBS \
|
||||
m
|
||||
|
||||
#if $[WINDOWS_PLATFORM]
|
||||
// Explicitly export the maya initialize and shutdown functions.
|
||||
#define LINKER_FLAGS $[LINKER_FLAGS] /export:initializePlugin /export:uninitializePlugin
|
||||
// On Windows, Maya expects its plugins to be named with a .mll
|
||||
// extension, but it's a perfectly normal dll otherwise. This
|
||||
// ppremake hack achieves that filename.
|
||||
#define dlllib mll
|
||||
#endif
|
||||
|
||||
#define SOURCES \
|
||||
mayaPview.cxx
|
||||
|
||||
#end lib_target
|
||||
|
60
pandatool/src/mayaprogs/mayaPview.cxx
Executable file
60
pandatool/src/mayaprogs/mayaPview.cxx
Executable file
@ -0,0 +1,60 @@
|
||||
// Filename: mayaPview.cxx
|
||||
// Created by: drose (10Mar03)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://www.panda3d.org/license.txt .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d@yahoogroups.com .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "pandaFramework.h"
|
||||
|
||||
#include "pre_maya_include.h"
|
||||
#include <maya/MSimple.h>
|
||||
#include "post_maya_include.h"
|
||||
|
||||
static PandaFramework framework;
|
||||
static bool opened_framework = false;
|
||||
|
||||
// This Maya macro sets up a class that meets the plug-in requirements
|
||||
// for a simple command.
|
||||
DeclareSimpleCommand(MayaPview, "VR Studio", "1.0");
|
||||
|
||||
MStatus MayaPview::
|
||||
doIt(const MArgList &) {
|
||||
if (!opened_framework) {
|
||||
int argc = 0;
|
||||
char **argv = NULL;
|
||||
framework.open_framework(argc, argv);
|
||||
framework.set_window_title("Panda Viewer");
|
||||
framework.enable_default_keys();
|
||||
}
|
||||
|
||||
WindowFramework *window = framework.open_window();
|
||||
if (window == (WindowFramework *)NULL) {
|
||||
// Couldn't open a window.
|
||||
nout << "Couldn't open a window!\n";
|
||||
return MS::kFailure;
|
||||
}
|
||||
|
||||
// We've successfully opened a window.
|
||||
|
||||
window->enable_keyboard();
|
||||
window->setup_trackball();
|
||||
|
||||
window->load_default_model(framework.get_models());
|
||||
window->loop_animations();
|
||||
|
||||
framework.clear_exit_flag();
|
||||
framework.main_loop();
|
||||
return MS::kSuccess;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user