Blender  V2.93
Functions | Variables
MANTA_main.cpp File Reference
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <zlib.h>
#include "MANTA_main.h"
#include "Python.h"
#include "fluid_script.h"
#include "liquid_script.h"
#include "manta.h"
#include "smoke_script.h"
#include "BLI_fileops.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "DNA_fluid_types.h"
#include "DNA_modifier_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"

Go to the source code of this file.

Functions

static string getCacheFileEnding (char cache_format)
 
static string getBooleanString (int value)
 
static string escapePath (string const &s)
 
static PyObject * callPythonFunction (string varName, string functionName, bool isAttribute=false)
 
static void * pyObjectToPointer (PyObject *inputObject)
 
static double pyObjectToDouble (PyObject *inputObject)
 
static long pyObjectToLong (PyObject *inputObject)
 
template<class T >
static TgetPointer (string pyObjectName, string pyFunctionName)
 

Variables

static PyObject * manta_main_module = nullptr
 

Function Documentation

◆ callPythonFunction()

static PyObject* callPythonFunction ( string  varName,
string  functionName,
bool  isAttribute = false 
)
static

Definition at line 1846 of file MANTA_main.cpp.

References manta_main_module, and MANTA::with_debug.

Referenced by MANTA::getFrame(), getPointer(), and MANTA::getTimestep().

◆ escapePath()

static string escapePath ( string const &  s)
static

◆ getBooleanString()

static string getBooleanString ( int  value)
static

Definition at line 676 of file MANTA_main.cpp.

◆ getCacheFileEnding()

static string getCacheFileEnding ( char  cache_format)
static

◆ getPointer()

template<class T >
static T* getPointer ( string  pyObjectName,
string  pyFunctionName 
)
static

Definition at line 1955 of file MANTA_main.cpp.

References callPythonFunction(), pyObjectToPointer(), and T.

Referenced by MANTA::updatePointers().

◆ pyObjectToDouble()

static double pyObjectToDouble ( PyObject *  inputObject)
static

Definition at line 1923 of file MANTA_main.cpp.

References result.

Referenced by MANTA::getTimestep().

◆ pyObjectToLong()

static long pyObjectToLong ( PyObject *  inputObject)
static

Definition at line 1941 of file MANTA_main.cpp.

References result.

Referenced by MANTA::getFrame().

◆ pyObjectToPointer()

static void* pyObjectToPointer ( PyObject *  inputObject)
static

Definition at line 1898 of file MANTA_main.cpp.

References result, and str.

Referenced by getPointer().

Variable Documentation

◆ manta_main_module

PyObject* manta_main_module = nullptr
static

Store a pointer to the main module used by mantaflow. This is necessary, because sometimes Blender will overwrite that module. That happens when e.g. scripts are executed in the text editor.

Mantaflow stores many variables in the globals() dict of the main module. To be able to access these variables, the same main module has to be used every time.

Unfortunately, we also depend on the fact that mantaflow dumps variables into this module using PyRun_SimpleString. So we can't easily create a separate module without changing mantaflow.

Definition at line 594 of file MANTA_main.cpp.

Referenced by callPythonFunction().