38 #include "RNA_prototypes.h"
50 ".. function:: getCurrentScene()\n"
52 " Returns the current scene.\n"
54 " :return: The current scene.\n"
55 " :rtype: :class:`bpy.types.Scene`\n";
61 PyErr_SetString(PyExc_TypeError,
"current scene not available");
133 ".. function:: blendRamp(type, color1, fac, color2)\n"
135 " Blend two colors according to a ramp blend type.\n"
137 " :arg type: Ramp blend type.\n"
139 " :arg color1: 1st color.\n"
140 " :type color1: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n"
141 " :arg fac: Blend factor.\n"
142 " :type fac: float\n"
143 " :arg color2: 1st color.\n"
144 " :type color2: :class:`mathutils.Vector`, list or tuple of 3 real numbers\n"
145 " :return: Blended color in RGB format.\n"
146 " :rtype: :class:`mathutils.Vector`\n";
150 PyObject *obj1, *obj2;
153 float a[3], fac,
b[3];
155 if (!PyArg_ParseTuple(args,
"sOfO", &s, &obj1, &fac, &obj2)) {
160 PyErr_SetString(PyExc_TypeError,
"argument 1 is an unknown ramp blend type");
167 "argument 2 must be a 3D vector "
168 "(either a tuple/list of 3 elements or Vector)") == -1) {
175 "argument 4 must be a 3D vector "
176 "(either a tuple/list of 3 elements or Vector)") == -1) {
186 ".. function:: evaluateColorRamp(ramp, in)\n"
188 " Evaluate a color ramp at a point in the interval 0 to 1.\n"
190 " :arg ramp: Color ramp object.\n"
191 " :type ramp: :class:`bpy.types.ColorRamp`\n"
192 " :arg in: Value in the interval 0 to 1.\n"
194 " :return: color in RGBA format.\n"
195 " :rtype: :class:`mathutils.Vector`\n";
207 PyErr_SetString(PyExc_TypeError,
"1st argument is not a ColorRamp object");
212 PyErr_SetString(PyExc_ValueError,
"failed to evaluate the color ramp");
222 ".. function:: evaluateCurveMappingF(cumap, cur, value)\n"
224 " Evaluate a curve mapping at a point in the interval 0 to 1.\n"
226 " :arg cumap: Curve mapping object.\n"
227 " :type cumap: :class:`bpy.types.CurveMapping`\n"
228 " :arg cur: Index of the curve to be used (0 <= cur <= 3).\n"
230 " :arg value: Input value in the interval 0 to 1.\n"
231 " :type value: float\n"
232 " :return: Mapped output value.\n"
242 if (!(PyArg_ParseTuple(args,
"O!if", &
pyrna_struct_Type, &py_srna, &cur, &value))) {
246 PyErr_SetString(PyExc_TypeError,
"1st argument is not a CurveMapping object");
249 if (cur < 0 || cur > 3) {
250 PyErr_SetString(PyExc_ValueError,
"2nd argument is out of range");
266 "This module provides classes for defining line drawing rules (such as\n"
267 "predicates, functions, chaining iterators, and stroke shaders), as well\n"
268 "as helper functions for style module writing.\n"
273 "- :class:`BinaryPredicate0D`\n"
274 "- :class:`BinaryPredicate1D`\n"
276 " - :class:`FalseBP1D`\n"
277 " - :class:`Length2DBP1D`\n"
278 " - :class:`SameShapeIdBP1D`\n"
279 " - :class:`TrueBP1D`\n"
280 " - :class:`ViewMapGradientNormBP1D`\n"
283 "- :class:`Interface0D`\n"
285 " - :class:`CurvePoint`\n"
287 " - :class:`StrokeVertex`\n"
289 " - :class:`SVertex`\n"
290 " - :class:`ViewVertex`\n"
292 " - :class:`NonTVertex`\n"
293 " - :class:`TVertex`\n"
295 "- :class:`Interface1D`\n"
297 " - :class:`Curve`\n"
299 " - :class:`Chain`\n"
301 " - :class:`FEdge`\n"
303 " - :class:`FEdgeSharp`\n"
304 " - :class:`FEdgeSmooth`\n"
306 " - :class:`Stroke`\n"
307 " - :class:`ViewEdge`\n"
309 "- :class:`Iterator`\n"
311 " - :class:`AdjacencyIterator`\n"
312 " - :class:`CurvePointIterator`\n"
313 " - :class:`Interface0DIterator`\n"
314 " - :class:`SVertexIterator`\n"
315 " - :class:`StrokeVertexIterator`\n"
316 " - :class:`ViewEdgeIterator`\n"
318 " - :class:`ChainingIterator`\n"
320 " - :class:`ChainPredicateIterator`\n"
321 " - :class:`ChainSilhouetteIterator`\n"
323 " - :class:`orientedViewEdgeIterator`\n"
325 "- :class:`Material`\n"
327 "- :class:`Operators`\n"
328 "- :class:`SShape`\n"
329 "- :class:`StrokeAttribute`\n"
330 "- :class:`StrokeShader`\n"
332 " - :class:`BackboneStretcherShader`\n"
333 " - :class:`BezierCurveShader`\n"
334 " - :class:`BlenderTextureShader`\n"
335 " - :class:`CalligraphicShader`\n"
336 " - :class:`ColorNoiseShader`\n"
337 " - :class:`ColorVariationPatternShader`\n"
338 " - :class:`ConstantColorShader`\n"
339 " - :class:`ConstantThicknessShader`\n"
340 " - :class:`ConstrainedIncreasingThicknessShader`\n"
341 " - :class:`GuidingLinesShader`\n"
342 " - :class:`IncreasingColorShader`\n"
343 " - :class:`IncreasingThicknessShader`\n"
344 " - :class:`PolygonalizationShader`\n"
345 " - :class:`SamplingShader`\n"
346 " - :class:`SmoothingShader`\n"
347 " - :class:`SpatialNoiseShader`\n"
348 " - :class:`StrokeTextureShader`\n"
349 " - :class:`StrokeTextureStepShader`\n"
350 " - :class:`TextureAssignerShader`\n"
351 " - :class:`ThicknessNoiseShader`\n"
352 " - :class:`ThicknessVariationPatternShader`\n"
353 " - :class:`TipRemoverShader`\n"
354 " - :class:`fstreamShader`\n"
355 " - :class:`streamShader`\n"
357 "- :class:`UnaryFunction0D`\n"
359 " - :class:`UnaryFunction0DDouble`\n"
361 " - :class:`Curvature2DAngleF0D`\n"
362 " - :class:`DensityF0D`\n"
363 " - :class:`GetProjectedXF0D`\n"
364 " - :class:`GetProjectedYF0D`\n"
365 " - :class:`GetProjectedZF0D`\n"
366 " - :class:`GetXF0D`\n"
367 " - :class:`GetYF0D`\n"
368 " - :class:`GetZF0D`\n"
369 " - :class:`LocalAverageDepthF0D`\n"
370 " - :class:`ZDiscontinuityF0D`\n"
372 " - :class:`UnaryFunction0DEdgeNature`\n"
374 " - :class:`CurveNatureF0D`\n"
376 " - :class:`UnaryFunction0DFloat`\n"
378 " - :class:`GetCurvilinearAbscissaF0D`\n"
379 " - :class:`GetParameterF0D`\n"
380 " - :class:`GetViewMapGradientNormF0D`\n"
381 " - :class:`ReadCompleteViewMapPixelF0D`\n"
382 " - :class:`ReadMapPixelF0D`\n"
383 " - :class:`ReadSteerableViewMapPixelF0D`\n"
385 " - :class:`UnaryFunction0DId`\n"
387 " - :class:`ShapeIdF0D`\n"
389 " - :class:`UnaryFunction0DMaterial`\n"
391 " - :class:`MaterialF0D`\n"
393 " - :class:`UnaryFunction0DUnsigned`\n"
395 " - :class:`QuantitativeInvisibilityF0D`\n"
397 " - :class:`UnaryFunction0DVec2f`\n"
399 " - :class:`Normal2DF0D`\n"
400 " - :class:`VertexOrientation2DF0D`\n"
402 " - :class:`UnaryFunction0DVec3f`\n"
404 " - :class:`VertexOrientation3DF0D`\n"
406 " - :class:`UnaryFunction0DVectorViewShape`\n"
408 " - :class:`GetOccludersF0D`\n"
410 " - :class:`UnaryFunction0DViewShape`\n"
412 " - :class:`GetOccludeeF0D`\n"
413 " - :class:`GetShapeF0D`\n"
415 "- :class:`UnaryFunction1D`\n"
417 " - :class:`UnaryFunction1DDouble`\n"
419 " - :class:`Curvature2DAngleF1D`\n"
420 " - :class:`DensityF1D`\n"
421 " - :class:`GetCompleteViewMapDensityF1D`\n"
422 " - :class:`GetDirectionalViewMapDensityF1D`\n"
423 " - :class:`GetProjectedXF1D`\n"
424 " - :class:`GetProjectedYF1D`\n"
425 " - :class:`GetProjectedZF1D`\n"
426 " - :class:`GetSteerableViewMapDensityF1D`\n"
427 " - :class:`GetViewMapGradientNormF1D`\n"
428 " - :class:`GetXF1D`\n"
429 " - :class:`GetYF1D`\n"
430 " - :class:`GetZF1D`\n"
431 " - :class:`LocalAverageDepthF1D`\n"
432 " - :class:`ZDiscontinuityF1D`\n"
434 " - :class:`UnaryFunction1DEdgeNature`\n"
436 " - :class:`CurveNatureF1D`\n"
438 " - :class:`UnaryFunction1DFloat`\n"
439 " - :class:`UnaryFunction1DUnsigned`\n"
441 " - :class:`QuantitativeInvisibilityF1D`\n"
443 " - :class:`UnaryFunction1DVec2f`\n"
445 " - :class:`Normal2DF1D`\n"
446 " - :class:`Orientation2DF1D`\n"
448 " - :class:`UnaryFunction1DVec3f`\n"
450 " - :class:`Orientation3DF1D`\n"
452 " - :class:`UnaryFunction1DVectorViewShape`\n"
454 " - :class:`GetOccludeeF1D`\n"
455 " - :class:`GetOccludersF1D`\n"
456 " - :class:`GetShapeF1D`\n"
458 " - :class:`UnaryFunction1DVoid`\n"
460 " - :class:`ChainingTimeStampF1D`\n"
461 " - :class:`IncrementChainingTimeStampF1D`\n"
462 " - :class:`TimeStampF1D`\n"
464 "- :class:`UnaryPredicate0D`\n"
466 " - :class:`FalseUP0D`\n"
467 " - :class:`TrueUP0D`\n"
469 "- :class:`UnaryPredicate1D`\n"
471 " - :class:`ContourUP1D`\n"
472 " - :class:`DensityLowerThanUP1D`\n"
473 " - :class:`EqualToChainingTimeStampUP1D`\n"
474 " - :class:`EqualToTimeStampUP1D`\n"
475 " - :class:`ExternalContourUP1D`\n"
476 " - :class:`FalseUP1D`\n"
477 " - :class:`QuantitativeInvisibilityUP1D`\n"
478 " - :class:`ShapeUP1D`\n"
479 " - :class:`TrueUP1D`\n"
480 " - :class:`WithinImageBoundaryUP1D`\n"
482 "- :class:`ViewMap`\n"
483 "- :class:`ViewShape`\n"
484 "- :class:`IntegrationType`\n"
485 "- :class:`MediumType`\n"
486 "- :class:`Nature`\n"
497 {
"evaluateColorRamp",
501 {
"evaluateCurveMappingF",
505 {
nullptr,
nullptr, 0,
nullptr},
511 PyModuleDef_HEAD_INIT,
535 PyObject *sys_path = PySys_GetObject(
"path");
536 PyObject *py_modpath = PyUnicode_FromString(modpath);
537 PyList_Append(sys_path, py_modpath);
538 Py_DECREF(py_modpath);
540 printf(
"Adding Python path: %s\n", modpath);
545 "Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.\n");
const char * BKE_appdir_folder_id(int folder_id, const char *subfolder)
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
General operations, lookup, etc. for materials.
void ramp_blend(int type, float r_col[3], float fac, const float col[3])
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
int BBox_Init(PyObject *module)
int BinaryPredicate0D_Init(PyObject *module)
int BinaryPredicate1D_Init(PyObject *module)
int ContextFunctions_Init(PyObject *module)
PyObject * Freestyle_Init(void)
static PyObject * Freestyle_evaluateCurveMappingF(PyObject *, PyObject *args)
static int ramp_blend_type(const char *type)
static char Freestyle_evaluateCurveMappingF___doc__[]
static PyModuleDef module_definition
static char module_docstring[]
static char Freestyle_evaluateColorRamp___doc__[]
static PyObject * Freestyle_blendRamp(PyObject *, PyObject *args)
static char Freestyle_getCurrentScene___doc__[]
static char Freestyle_blendRamp___doc__[]
static PyObject * Freestyle_getCurrentScene(PyObject *)
static PyObject * Freestyle_evaluateColorRamp(PyObject *, PyObject *args)
static PyMethodDef module_functions[]
int FrsMaterial_Init(PyObject *module)
int FrsNoise_Init(PyObject *module)
int Id_Init(PyObject *module)
int IntegrationType_Init(PyObject *module)
int Interface0D_Init(PyObject *module)
int Interface1D_Init(PyObject *module)
int Iterator_Init(PyObject *module)
int MediumType_Init(PyObject *module)
int Nature_Init(PyObject *module)
int Operators_Init(PyObject *module)
int SShape_Init(PyObject *module)
int StrokeAttribute_Init(PyObject *module)
int StrokeShader_Init(PyObject *module)
int UnaryFunction0D_Init(PyObject *module)
int UnaryFunction1D_Init(PyObject *module)
int UnaryPredicate0D_Init(PyObject *module)
int UnaryPredicate1D_Init(PyObject *module)
int ViewMap_Init(PyObject *module)
int ViewShape_Init(PyObject *module)
@ CUMA_EXTEND_EXTRAPOLATE
struct FreestyleGlobals g_freestyle
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
PyObject * pyrna_struct_CreatePyObject(PointerRNA *ptr)
PyTypeObject pyrna_struct_Type
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
PyObject * Vector_CreatePyObject(const float *vec, const int vec_num, PyTypeObject *base_type)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static struct PyModuleDef module
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PyObject_HEAD PointerRNA ptr