AL_USDMaya  0.29.4
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Global.h
1 //
2 // Copyright 2017 Animal Logic
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.//
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 #pragma once
17 
18 #include "./Api.h"
19 
20 #include "maya/MSceneMessage.h"
21 #include "AL/usd/utils/ForwardDeclares.h"
22 #include "AL/event/EventHandler.h"
23 
24 namespace AL {
25 namespace usdmaya {
26 
27 //----------------------------------------------------------------------------------------------------------------------
31 //----------------------------------------------------------------------------------------------------------------------
32 class Global
33 {
34 public:
35 
37  AL_USDMAYA_PUBLIC
38  static void onPluginLoad();
39 
41  AL_USDMAYA_PUBLIC
42  static void onPluginUnload();
43 
45  static AL::event::CallbackId preSave()
46  { return m_preSave; }
47 
49  static AL::event::CallbackId postSave()
50  { return m_postSave; }
51 
53  static AL::event::CallbackId preRead()
54  { return m_preRead; }
55 
57  static AL::event::CallbackId postRead()
58  { return m_postRead; }
59 
61  static AL::event::CallbackId fileNew()
62  { return m_fileNew; }
63 
64 private:
65  static AL::event::CallbackId m_preSave;
66  static AL::event::CallbackId m_postSave;
67  static AL::event::CallbackId m_preRead;
68  static AL::event::CallbackId m_postRead;
69  static AL::event::CallbackId m_fileNew;
70  static AL::event::CallbackId m_preExport;
71  static AL::event::CallbackId m_postExport;
72 };
73 
74 //----------------------------------------------------------------------------------------------------------------------
75 } // usdmaya
76 } // al
77 //----------------------------------------------------------------------------------------------------------------------
78 
This class wraps all of the global state/mechanisms needed to integrate USD and Maya. This mainly handles things such as onFileNew, preFileSave, etc.
Definition: Global.h:32
static AL_USDMAYA_PUBLIC void onPluginLoad()
initialise the global state
static AL::event::CallbackId preSave()
pre save callback
Definition: Global.h:45
static AL::event::CallbackId fileNew()
callback used to flush the USD caches after a file new
Definition: Global.h:61
static AL::event::CallbackId preRead()
pre open callback
Definition: Global.h:53
static AL::event::CallbackId postRead()
post open callback
Definition: Global.h:57
static AL::event::CallbackId postSave()
post save callback
Definition: Global.h:49
static AL_USDMAYA_PUBLIC void onPluginUnload()
uninitialise the global state