Parameter Editor mode. This is a WIP commit. Only the base line color, base alpha transparency, and base line thickness are respected. More additions are anticipated to account for other parameters. * Added FRS_finish_stroke_rendering() to clean Freestyle-related temporary resources after stroke rendering. * Some functions in FRS_freestyle.cpp are now declared as static functions, so as not to mess up the program-wide name space. * Made the StyleModule class inheritable, and defined new subclass BlenderStyleModule that takes a Text object instead of a file name.
40 lines
780 B
C++
40 lines
780 B
C++
#ifndef BLENDERSTYLEMODULE_H
|
|
#define BLENDERSTYLEMODULE_H
|
|
|
|
#include "../stroke/StyleModule.h"
|
|
#include "../system/PythonInterpreter.h"
|
|
|
|
extern "C" {
|
|
#include "BKE_global.h"
|
|
#include "BKE_library.h"
|
|
#include "BKE_text.h"
|
|
}
|
|
|
|
class BlenderStyleModule : public StyleModule
|
|
{
|
|
public:
|
|
|
|
BlenderStyleModule(struct Text *text, const string &name,
|
|
Interpreter *inter) : StyleModule(name, inter) {
|
|
_text = text;
|
|
}
|
|
|
|
virtual ~BlenderStyleModule() {
|
|
unlink_text(G.main, _text);
|
|
free_libblock(&G.main->text, _text);
|
|
}
|
|
|
|
protected:
|
|
|
|
virtual int interpret() {
|
|
PythonInterpreter* py_inter = dynamic_cast<PythonInterpreter*>(_inter);
|
|
assert(py_inter != 0);
|
|
return py_inter->interpretText(_text, getFileName());
|
|
}
|
|
|
|
private:
|
|
struct Text *_text;
|
|
};
|
|
|
|
#endif // BLENDERSTYLEMODULE_H
|