Open Reality Reference Guide
 
Loading...
Searching...
No Matches
fbpython.h
1#ifndef __FBPYTHON_H__
2#define __FBPYTHON_H__
3/**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36
37**************************************************************************/
38
45#include <kaydaradef.h>
46#ifndef FBSDK_DLL
50 #define FBSDK_DLL K_DLLIMPORT
51#endif
52
53#include <kaydara.h>
54
55#include <fbsdk/fbversion.h>
56
57#ifdef FBSDKUseNamespace
58 namespace FBSDKNamespace {
59#endif
60
62{
63public:
64
65 FBPythonContext(const char* pName);
67
68 const char* GetName();
69
70private:
71
72 friend class FBPython;
73 struct Data;
74 Data* mConcreteContext;
75};
76
151{
152public:
153
157 static const char* GetVersion();
158
162 static const char* GetPlatform();
163
168 static const char* GetStdout(FBPythonContext* pPythonContext = NULL);
169
174 static const char* GetStderr(FBPythonContext* pPythonContext = NULL);
175
182 static bool ParseLine(const char* pLine, FBPythonContext* pPythonContext = NULL);
183
191 static bool EvalLine(FBPythonContext* pPythonContext = NULL);
192
201 static bool EvalLines(const char* pScript, FBPythonContext* pPythonContext = NULL);
202
212 static bool EvalFile(const char* pFilename, FBPythonContext* pPythonContext = NULL);
213
221 static bool ExecuteScript(const char* pFilename, FBPythonContext* pPythonContext = nullptr);
222
228 static bool ClearContext(FBPythonContext* pPythonContext = NULL);
229};
230
231#ifdef FBSDKUseNamespace
232 }
233#endif
234#endif
FBPython is for python users to run python script and communicate with MotionBuilder internal python ...
Definition fbpython.h:151
static bool EvalFile(const char *pFilename, FBPythonContext *pPythonContext=NULL)
Execute a python script file within the given context.
static bool EvalLine(FBPythonContext *pPythonContext=NULL)
Submit the last line (or last few lines) of code parsed for evaluation.
static const char * GetStderr(FBPythonContext *pPythonContext=NULL)
Get the value of stderr.
static const char * GetVersion()
Get the version of the Python interpreter.
static const char * GetStdout(FBPythonContext *pPythonContext=NULL)
Get the value of stdout.
static bool ParseLine(const char *pLine, FBPythonContext *pPythonContext=NULL)
Submit a line of code for parsing.
static const char * GetPlatform()
Get the target platform of the Python interpreter.
static bool EvalLines(const char *pScript, FBPythonContext *pPythonContext=NULL)
Submit a script for parsing and execution.
static bool ClearContext(FBPythonContext *pPythonContext=NULL)
Clears the python context.
static bool ExecuteScript(const char *pFilename, FBPythonContext *pPythonContext=nullptr)
Put a python script file in the execution queue to be executed on the next UI thread idle callback.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...