2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-01-02 23:05:28 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-01-02 23:05:28 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup RNA
|
2011-02-27 20:20:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2009-01-03 01:55:37 +00:00
|
|
|
#include <float.h>
|
2009-06-03 23:22:43 +00:00
|
|
|
#include <stdio.h>
|
2009-01-03 01:55:37 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2009-06-03 23:22:43 +00:00
|
|
|
#include "DNA_brush_types.h"
|
2019-02-27 12:34:56 +11:00
|
|
|
#include "DNA_light_types.h"
|
2009-01-03 08:08:44 +00:00
|
|
|
#include "DNA_material_types.h"
|
2009-08-17 18:37:58 +00:00
|
|
|
#include "DNA_node_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_object_types.h"
|
2016-12-28 17:30:58 +01:00
|
|
|
#include "DNA_particle_types.h"
|
- add torus back from 2.4x as an operator
bpy.ops.mesh.primitive_torus_add(major_radius=1, minor_radius=0.25, major_segments=48, minor_segments=16)
- experemental dynamic menus, used for INFO_MT_file, INFO_MT_file_import, INFO_MT_file_export and INFO_MT_mesh_add. these can have items added from python.
eg.
- removed OBJECT_OT_mesh_add, use the python add menu instead.
- made mesh primitive ops - MESH_OT_primitive_plane_add, ...cube_add, etc. work in object mode.
- RNA scene.active_object wrapped
- bugfix [#19466] 2.5: Tweak menu only available for mesh objects added within Edit Mode
ED_object_exit_editmode was always doing an undo push, made this optional using the existing flag - EM_DO_UNDO, called everywhere except when adding primitives.
2009-10-10 21:23:20 +00:00
|
|
|
#include "DNA_scene_types.h" /* MAXFRAME only */
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_texture_types.h"
|
|
|
|
|
#include "DNA_world_types.h"
|
2009-08-17 18:37:58 +00:00
|
|
|
|
2013-01-24 21:57:13 +00:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
2009-08-17 18:37:58 +00:00
|
|
|
#include "BKE_node.h"
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
#include "BKE_paint.h"
|
2009-01-02 23:05:28 +00:00
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "RNA_define.h"
|
|
|
|
|
#include "RNA_enum_types.h"
|
|
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
|
2012-11-26 08:52:07 +00:00
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2013-09-11 21:27:14 +00:00
|
|
|
#ifndef RNA_RUNTIME
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem texture_filter_items[] = {
|
2009-07-22 17:20:04 +00:00
|
|
|
{TXF_BOX, "BOX", 0, "Box", ""},
|
2009-07-21 13:20:35 +00:00
|
|
|
{TXF_EWA, "EWA", 0, "EWA", ""},
|
|
|
|
|
{TXF_FELINE, "FELINE", 0, "FELINE", ""},
|
|
|
|
|
{TXF_AREA, "AREA", 0, "Area", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2013-09-11 21:27:14 +00:00
|
|
|
#endif
|
2009-07-21 13:20:35 +00:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
const EnumPropertyItem rna_enum_texture_type_items[] = {
|
2010-01-17 20:06:34 +00:00
|
|
|
{0, "NONE", 0, "None", ""},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - create a ramp texture"},
|
|
|
|
|
{TEX_CLOUDS,
|
|
|
|
|
"CLOUDS",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Clouds",
|
|
|
|
|
"Procedural - create a cloud-like fractal noise texture"},
|
|
|
|
|
{TEX_DISTNOISE,
|
|
|
|
|
"DISTORTED_NOISE",
|
|
|
|
|
ICON_TEXTURE,
|
2011-11-26 12:30:01 +00:00
|
|
|
"Distorted Noise",
|
|
|
|
|
"Procedural - noise texture distorted by two noise algorithms"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_IMAGE,
|
|
|
|
|
"IMAGE",
|
|
|
|
|
ICON_IMAGE_DATA,
|
|
|
|
|
"Image or Movie",
|
|
|
|
|
"Allow for images or movies to be used as textures"},
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEX_MAGIC,
|
|
|
|
|
"MAGIC",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Magic",
|
|
|
|
|
"Procedural - color texture based on trigonometric functions"},
|
|
|
|
|
{TEX_MARBLE,
|
|
|
|
|
"MARBLE",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Marble",
|
|
|
|
|
"Procedural - marble-like noise texture with wave generated bands"},
|
|
|
|
|
{TEX_MUSGRAVE,
|
|
|
|
|
"MUSGRAVE",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Musgrave",
|
|
|
|
|
"Procedural - highly flexible fractal noise texture"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_NOISE,
|
|
|
|
|
"NOISE",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Noise",
|
2011-11-26 12:30:01 +00:00
|
|
|
"Procedural - random noise, gives a different result every time, for every frame, for every "
|
|
|
|
|
"pixel"},
|
|
|
|
|
{TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"},
|
|
|
|
|
{TEX_VORONOI,
|
|
|
|
|
"VORONOI",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Voronoi",
|
|
|
|
|
"Procedural - create cell-like patterns based on Worley noise"},
|
|
|
|
|
{TEX_WOOD,
|
|
|
|
|
"WOOD",
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
"Wood",
|
|
|
|
|
"Procedural - wave generated bands or rings, with optional noise"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2010-01-17 20:06:34 +00:00
|
|
|
|
2013-09-11 21:27:14 +00:00
|
|
|
#ifndef RNA_RUNTIME
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem blend_type_items[] = {
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_BLEND, "MIX", 0, "Mix", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{0, "", ICON_NONE, NULL, NULL},
|
|
|
|
|
{MTEX_DARK, "DARKEN", 0, "Darken", ""},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_MUL, "MULTIPLY", 0, "Multiply", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{0, "", ICON_NONE, NULL, NULL},
|
|
|
|
|
{MTEX_LIGHT, "LIGHTEN", 0, "Lighten", ""},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_SCREEN, "SCREEN", 0, "Screen", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{MTEX_ADD, "ADD", 0, "Add", ""},
|
|
|
|
|
{0, "", ICON_NONE, NULL, NULL},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_OVERLAY, "OVERLAY", 0, "Overlay", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""},
|
|
|
|
|
{MTEX_LIN_LIGHT, "LINEAR_LIGHT", 0, "Linear Light", ""},
|
|
|
|
|
{0, "", ICON_NONE, NULL, NULL},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_DIFF, "DIFFERENCE", 0, "Difference", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{MTEX_SUB, "SUBTRACT", 0, "Subtract", ""},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_DIV, "DIVIDE", 0, "Divide", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{0, "", ICON_NONE, NULL, NULL},
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_BLEND_HUE, "HUE", 0, "Hue", ""},
|
|
|
|
|
{MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""},
|
|
|
|
|
{MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""},
|
2018-10-19 16:56:38 +02:00
|
|
|
{MTEX_BLEND_VAL, "VALUE", 0, "Value", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2013-09-11 21:27:14 +00:00
|
|
|
#endif
|
2011-11-07 17:35:20 +00:00
|
|
|
|
2009-01-02 23:05:28 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
2009-10-27 10:14:02 +00:00
|
|
|
# include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
# include "RNA_access.h"
|
|
|
|
|
|
2017-12-07 15:36:26 +11:00
|
|
|
# include "BKE_colorband.h"
|
2013-03-18 16:34:57 +00:00
|
|
|
# include "BKE_context.h"
|
2010-06-01 06:07:22 +00:00
|
|
|
# include "BKE_image.h"
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
# include "BKE_main.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "BKE_texture.h"
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
# include "DEG_depsgraph.h"
|
2020-10-30 12:12:25 +01:00
|
|
|
# include "DEG_depsgraph_build.h"
|
2017-06-08 10:14:53 +02:00
|
|
|
|
2009-08-19 00:55:30 +00:00
|
|
|
# include "ED_node.h"
|
2014-11-18 16:05:47 +01:00
|
|
|
# include "ED_render.h"
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2009-09-14 16:52:06 +00:00
|
|
|
static StructRNA *rna_Texture_refine(struct PointerRNA *ptr)
|
2009-03-23 11:08:01 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Tex *tex = (Tex *)ptr->data;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
switch (tex->type) {
|
2009-11-16 20:02:58 +00:00
|
|
|
case TEX_BLEND:
|
2012-03-18 09:27:36 +00:00
|
|
|
return &RNA_BlendTexture;
|
2009-03-23 11:10:07 +00:00
|
|
|
case TEX_CLOUDS:
|
2009-03-23 11:08:01 +00:00
|
|
|
return &RNA_CloudsTexture;
|
2009-11-16 20:02:58 +00:00
|
|
|
case TEX_DISTNOISE:
|
|
|
|
|
return &RNA_DistortedNoiseTexture;
|
|
|
|
|
case TEX_IMAGE:
|
|
|
|
|
return &RNA_ImageTexture;
|
2009-03-23 11:08:01 +00:00
|
|
|
case TEX_MAGIC:
|
|
|
|
|
return &RNA_MagicTexture;
|
2009-11-16 20:02:58 +00:00
|
|
|
case TEX_MARBLE:
|
|
|
|
|
return &RNA_MarbleTexture;
|
|
|
|
|
case TEX_MUSGRAVE:
|
|
|
|
|
return &RNA_MusgraveTexture;
|
2009-04-09 20:33:39 +00:00
|
|
|
case TEX_NOISE:
|
2009-03-23 11:08:01 +00:00
|
|
|
return &RNA_NoiseTexture;
|
2009-11-16 20:02:58 +00:00
|
|
|
case TEX_STUCCI:
|
|
|
|
|
return &RNA_StucciTexture;
|
|
|
|
|
case TEX_VORONOI:
|
|
|
|
|
return &RNA_VoronoiTexture;
|
|
|
|
|
case TEX_WOOD:
|
|
|
|
|
return &RNA_WoodTexture;
|
2009-03-23 11:08:01 +00:00
|
|
|
default:
|
|
|
|
|
return &RNA_Texture;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-07 17:35:20 +00:00
|
|
|
static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
{
|
2019-08-23 09:52:12 +02:00
|
|
|
ID *id = ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (GS(id->name) == ID_TE) {
|
2019-08-23 09:52:12 +02:00
|
|
|
Tex *tex = (Tex *)ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(&tex->id, 0);
|
2018-12-06 17:52:37 +01:00
|
|
|
DEG_id_tag_update(&tex->id, ID_RECALC_EDITORS);
|
2011-11-07 17:35:20 +00:00
|
|
|
WM_main_add_notifier(NC_TEXTURE, tex);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, NULL);
|
2011-11-07 17:35:20 +00:00
|
|
|
}
|
2012-03-05 23:30:41 +00:00
|
|
|
else if (GS(id->name) == ID_NT) {
|
2019-08-23 09:52:12 +02:00
|
|
|
bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
|
2016-02-05 01:39:42 +05:00
|
|
|
ED_node_tag_update_nodetree(bmain, ntree, NULL);
|
2011-11-07 17:35:20 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_Texture_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
TexMapping *texmap = ptr->data;
|
2015-03-29 03:16:55 +11:00
|
|
|
BKE_texture_mapping_init(texmap);
|
2011-11-07 17:35:20 +00:00
|
|
|
rna_Texture_update(bmain, scene, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-20 06:35:28 +00:00
|
|
|
static void rna_Color_mapping_update(Main *UNUSED(bmain),
|
|
|
|
|
Scene *UNUSED(scene),
|
|
|
|
|
PointerRNA *UNUSED(ptr))
|
2011-11-07 17:35:20 +00:00
|
|
|
{
|
|
|
|
|
/* nothing to do */
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
}
|
|
|
|
|
|
2009-12-05 21:14:31 +00:00
|
|
|
/* Used for Texture Properties, used (also) for/in Nodes */
|
2011-10-20 00:19:21 +00:00
|
|
|
static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
2009-10-07 14:48:29 +00:00
|
|
|
{
|
2019-08-23 09:52:12 +02:00
|
|
|
Tex *tex = (Tex *)ptr->owner_id;
|
2009-10-07 14:48:29 +00:00
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(&tex->id, 0);
|
2018-12-06 17:52:37 +01:00
|
|
|
DEG_id_tag_update(&tex->id, ID_RECALC_EDITORS);
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_TEXTURE | ND_NODES, tex);
|
2009-10-07 14:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
2009-08-13 05:21:25 +00:00
|
|
|
static void rna_Texture_type_set(PointerRNA *ptr, int value)
|
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Tex *tex = (Tex *)ptr->data;
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2015-03-29 03:16:55 +11:00
|
|
|
BKE_texture_type_set(tex, value);
|
2009-08-13 05:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2020-10-30 12:12:25 +01:00
|
|
|
void rna_TextureSlotTexture_update(bContext *C, PointerRNA *ptr)
|
|
|
|
|
{
|
|
|
|
|
DEG_relations_tag_update(CTX_data_main(C));
|
|
|
|
|
rna_TextureSlot_update(C, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-19 12:22:25 +02:00
|
|
|
void rna_TextureSlot_update(bContext *C, PointerRNA *ptr)
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
{
|
2019-08-23 09:52:12 +02:00
|
|
|
ID *id = ptr->owner_id;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(id, 0);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
switch (GS(id->name)) {
|
2012-03-18 09:27:36 +00:00
|
|
|
case ID_MA:
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_MATERIAL | ND_SHADING, id);
|
|
|
|
|
WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, id);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
break;
|
2012-03-18 09:27:36 +00:00
|
|
|
case ID_WO:
|
2009-12-08 17:23:48 +00:00
|
|
|
WM_main_add_notifier(NC_WORLD, id);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
break;
|
2012-03-18 09:27:36 +00:00
|
|
|
case ID_LA:
|
2012-05-12 11:01:29 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, id);
|
2012-11-24 14:50:40 +00:00
|
|
|
WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, id);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
break;
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
case ID_BR: {
|
2017-04-19 12:22:25 +02:00
|
|
|
Scene *scene = CTX_data_scene(C);
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
MTex *mtex = ptr->data;
|
2017-11-22 10:52:39 -02:00
|
|
|
ViewLayer *view_layer = CTX_data_view_layer(C);
|
2018-04-05 18:20:27 +02:00
|
|
|
BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex);
|
2009-12-08 17:23:48 +00:00
|
|
|
WM_main_add_notifier(NC_BRUSH, id);
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2014-04-23 13:39:58 +09:00
|
|
|
case ID_LS:
|
|
|
|
|
WM_main_add_notifier(NC_LINESTYLE, id);
|
|
|
|
|
break;
|
2016-12-28 17:30:58 +01:00
|
|
|
case ID_PA: {
|
|
|
|
|
MTex *mtex = ptr->data;
|
2018-12-06 17:52:37 +01:00
|
|
|
int recalc = ID_RECALC_GEOMETRY;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (mtex->mapto & PAMAP_INIT) {
|
2018-12-06 17:52:37 +01:00
|
|
|
recalc |= ID_RECALC_PSYS_RESET;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
|
|
|
|
if (mtex->mapto & PAMAP_CHILD) {
|
2018-12-06 17:52:37 +01:00
|
|
|
recalc |= ID_RECALC_PSYS_CHILD;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(id, recalc);
|
2016-12-28 17:30:58 +01:00
|
|
|
WM_main_add_notifier(NC_OBJECT | ND_PARTICLE | NA_EDITED, NULL);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2017-08-28 11:19:58 +02:00
|
|
|
default:
|
|
|
|
|
break;
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-26 11:56:12 +00:00
|
|
|
char *rna_TextureSlot_path(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MTex *mtex = ptr->data;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-10-26 11:56:12 +00:00
|
|
|
/* if there is ID-data, resolve the path using the index instead of by name,
|
|
|
|
|
* since the name used is the name of the texture assigned, but the texture
|
|
|
|
|
* may be used multiple times in the same stack
|
|
|
|
|
*/
|
2019-08-23 09:52:12 +02:00
|
|
|
if (ptr->owner_id) {
|
|
|
|
|
if (GS(ptr->owner_id->name) == ID_BR) {
|
2012-12-06 21:59:16 +00:00
|
|
|
return BLI_strdup("texture_slot");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
PointerRNA id_ptr;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-06 21:59:16 +00:00
|
|
|
/* find the 'textures' property of the ID-struct */
|
2019-08-23 09:52:12 +02:00
|
|
|
RNA_id_pointer_create(ptr->owner_id, &id_ptr);
|
2012-12-06 21:59:16 +00:00
|
|
|
prop = RNA_struct_find_property(&id_ptr, "texture_slots");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-06 21:59:16 +00:00
|
|
|
/* get an iterator for this property, and try to find the relevant index */
|
|
|
|
|
if (prop) {
|
|
|
|
|
int index = RNA_property_collection_lookup_index(&id_ptr, prop, ptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-02-01 01:45:09 +11:00
|
|
|
if (index != -1) {
|
2012-12-06 21:59:16 +00:00
|
|
|
return BLI_sprintfN("texture_slots[%d]", index);
|
2014-02-01 01:45:09 +11:00
|
|
|
}
|
2012-12-06 21:59:16 +00:00
|
|
|
}
|
2009-10-26 11:56:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-10-26 11:56:12 +00:00
|
|
|
/* this is a compromise for the remaining cases... */
|
2013-04-23 20:10:22 +00:00
|
|
|
if (mtex->tex) {
|
|
|
|
|
char name_esc[(sizeof(mtex->tex->id.name) - 2) * 2];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-12-10 13:25:49 +11:00
|
|
|
BLI_str_escape(name_esc, mtex->tex->id.name + 2, sizeof(name_esc));
|
2013-04-23 20:10:22 +00:00
|
|
|
return BLI_sprintfN("texture_slots[\"%s\"]", name_esc);
|
|
|
|
|
}
|
|
|
|
|
else {
|
2010-02-07 12:51:47 +00:00
|
|
|
return BLI_strdup("texture_slots[0]");
|
2013-04-23 20:10:22 +00:00
|
|
|
}
|
2009-10-26 11:56:12 +00:00
|
|
|
}
|
|
|
|
|
|
2009-06-03 23:22:43 +00:00
|
|
|
static int rna_TextureSlot_name_length(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MTex *mtex = ptr->data;
|
2009-06-03 23:22:43 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (mtex->tex) {
|
2012-05-12 11:01:29 +00:00
|
|
|
return strlen(mtex->tex->id.name + 2);
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2009-06-07 13:09:18 +00:00
|
|
|
return 0;
|
2009-06-03 23:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MTex *mtex = ptr->data;
|
2009-06-03 23:22:43 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (mtex->tex) {
|
2012-05-12 11:01:29 +00:00
|
|
|
strcpy(str, mtex->tex->id.name + 2);
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
|
|
|
|
else {
|
2012-03-05 23:30:41 +00:00
|
|
|
str[0] = '\0';
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2009-06-03 23:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
2009-08-18 19:58:27 +00:00
|
|
|
static int rna_TextureSlot_output_node_get(PointerRNA *ptr)
|
|
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MTex *mtex = ptr->data;
|
|
|
|
|
Tex *tex = mtex->tex;
|
|
|
|
|
int cur = mtex->which_output;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (tex) {
|
|
|
|
|
bNodeTree *ntree = tex->nodetree;
|
2009-08-18 19:58:27 +00:00
|
|
|
bNode *node;
|
2012-03-05 23:30:41 +00:00
|
|
|
if (ntree) {
|
|
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
|
if (node->type == TEX_NODE_OUTPUT) {
|
2019-06-04 00:21:57 +10:00
|
|
|
if (cur == node->custom1) {
|
2009-08-18 19:58:27 +00:00
|
|
|
return cur;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2009-08-18 19:58:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
mtex->which_output = 0;
|
2009-08-18 19:58:27 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *UNUSED(C),
|
|
|
|
|
PointerRNA *ptr,
|
|
|
|
|
PropertyRNA *UNUSED(prop),
|
|
|
|
|
bool *r_free)
|
2009-08-17 18:37:58 +00:00
|
|
|
{
|
2012-03-05 23:30:41 +00:00
|
|
|
MTex *mtex = ptr->data;
|
|
|
|
|
Tex *tex = mtex->tex;
|
|
|
|
|
EnumPropertyItem *item = NULL;
|
|
|
|
|
int totitem = 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (tex) {
|
|
|
|
|
bNodeTree *ntree = tex->nodetree;
|
|
|
|
|
if (ntree) {
|
|
|
|
|
EnumPropertyItem tmp = {0, "", 0, "", ""};
|
2009-08-17 18:37:58 +00:00
|
|
|
bNode *node;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-17 18:37:58 +00:00
|
|
|
tmp.value = 0;
|
|
|
|
|
tmp.name = "Not Specified";
|
|
|
|
|
tmp.identifier = "NOT_SPECIFIED";
|
|
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
for (node = ntree->nodes.first; node; node = node->next) {
|
|
|
|
|
if (node->type == TEX_NODE_OUTPUT) {
|
|
|
|
|
tmp.value = node->custom1;
|
2012-05-12 11:01:29 +00:00
|
|
|
tmp.name = ((TexNodeOutput *)node->storage)->name;
|
2009-08-17 18:37:58 +00:00
|
|
|
tmp.identifier = tmp.name;
|
|
|
|
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_enum_item_end(&item, &totitem);
|
2014-01-04 18:08:43 +11:00
|
|
|
*r_free = true;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-17 18:37:58 +00:00
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, bool value)
|
2009-07-21 12:57:55 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Tex *tex = (Tex *)ptr->data;
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (value) {
|
2012-03-05 23:30:41 +00:00
|
|
|
tex->flag |= TEX_COLORBAND;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
|
|
|
|
else {
|
2009-07-21 12:57:55 +00:00
|
|
|
tex->flag &= ~TEX_COLORBAND;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2009-07-21 12:57:55 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if ((tex->flag & TEX_COLORBAND) && tex->coba == NULL) {
|
2017-12-07 15:52:59 +11:00
|
|
|
tex->coba = BKE_colorband_add(false);
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2009-07-21 12:57:55 +00:00
|
|
|
}
|
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
static void rna_Texture_use_nodes_update(bContext *C, PointerRNA *ptr)
|
2009-08-17 18:37:58 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Tex *tex = (Tex *)ptr->data;
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
if (tex->use_nodes) {
|
|
|
|
|
tex->type = 0;
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (tex->nodetree == NULL) {
|
2013-03-18 16:34:57 +00:00
|
|
|
ED_node_texture_default(C, tex);
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
2018-06-09 14:40:09 +02:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
rna_Texture_nodes_update(CTX_data_main(C), CTX_data_scene(C), ptr);
|
2009-08-17 18:37:58 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-05 22:25:34 +02:00
|
|
|
static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, bool value)
|
2009-07-21 13:20:35 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
Tex *tex = (Tex *)ptr->data;
|
2009-07-21 13:20:35 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (value) {
|
2012-03-05 23:30:41 +00:00
|
|
|
tex->imaflag |= TEX_MIPMAP;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
|
|
|
|
else {
|
2009-07-21 13:20:35 +00:00
|
|
|
tex->imaflag &= ~TEX_MIPMAP;
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2009-07-21 13:20:35 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-02 23:05:28 +00:00
|
|
|
#else
|
|
|
|
|
|
2009-03-24 17:40:58 +00:00
|
|
|
static void rna_def_texmapping(BlenderRNA *brna)
|
|
|
|
|
{
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_mapping_items[] = {
|
2011-11-07 17:35:20 +00:00
|
|
|
{MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
|
|
|
|
|
{MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
|
|
|
|
|
{MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
|
|
|
|
|
{MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_xyz_mapping_items[] = {
|
2011-11-07 17:35:20 +00:00
|
|
|
{0, "NONE", 0, "None", ""},
|
|
|
|
|
{1, "X", 0, "X", ""},
|
|
|
|
|
{2, "Y", 0, "Y", ""},
|
|
|
|
|
{3, "Z", 0, "Z", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-03-24 17:40:58 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "TexMapping", NULL);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Texture Mapping", "Texture coordinate mapping settings");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-10-02 17:02:59 +00:00
|
|
|
prop = RNA_def_property(srna, "vector_type", PROP_ENUM, PROP_NONE);
|
2013-09-25 20:28:49 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "type");
|
2019-09-04 23:17:13 +02:00
|
|
|
RNA_def_property_enum_items(prop, rna_enum_mapping_type_items);
|
2013-09-25 20:28:49 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Type", "Type of vector that the mapping transforms");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-04-04 16:11:39 +00:00
|
|
|
prop = RNA_def_property(srna, "translation", PROP_FLOAT, PROP_TRANSLATION);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "loc");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Location", "");
|
2012-04-10 08:33:30 +00:00
|
|
|
RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-05-12 11:01:29 +00:00
|
|
|
/* Not PROP_XYZ, this is now in radians, no more degrees */
|
2012-03-18 09:27:36 +00:00
|
|
|
prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "rot");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Rotation", "");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "size");
|
2014-02-09 08:42:45 +11:00
|
|
|
RNA_def_property_flag(prop, PROP_PROPORTIONAL);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Scale", "");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "min");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "max");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE);
|
2009-03-24 17:40:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "projx");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "X Mapping", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "projy");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Y Mapping", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "projz");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_xyz_mapping_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Z Mapping", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_mapping_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Mapping", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
|
2009-03-24 17:40:58 +00:00
|
|
|
}
|
|
|
|
|
|
2011-11-07 17:35:20 +00:00
|
|
|
static void rna_def_colormapping(BlenderRNA *brna)
|
2009-01-03 08:08:44 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "ColorMapping", NULL);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Color Mapping", "Color mapping settings");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", COLORMAP_USE_RAMP);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "coba");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ColorRamp");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Color Ramp", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bright");
|
|
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
|
2013-01-14 20:27:25 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 5);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 5, 1, 3);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_items(prop, blend_type_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Blend Type", "Mode used to mix with texture output color");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "blend_color", PROP_FLOAT, PROP_COLOR);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_array(prop, 3);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Color", "Blend color to mix with texture output color");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE);
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Blend Factor", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Color_mapping_update");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_mtex(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem output_node_items[] = {
|
2009-08-17 18:37:58 +00:00
|
|
|
{0, "DUMMY", 0, "Dummy", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "TextureSlot", NULL);
|
2009-01-03 08:08:44 +00:00
|
|
|
RNA_def_struct_sdna(srna, "MTex");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(
|
|
|
|
|
srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture");
|
2009-10-26 11:56:12 +00:00
|
|
|
RNA_def_struct_path_func(srna, "rna_TextureSlot_path");
|
2009-06-03 23:33:56 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
|
2009-01-03 08:08:44 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "tex");
|
|
|
|
|
RNA_def_property_struct_type(prop, "Texture");
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_CONTEXT_UPDATE);
|
2019-08-20 17:48:10 +02:00
|
|
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
2015-10-24 02:44:43 +11:00
|
|
|
RNA_def_property_ui_text(prop, "Texture", "Texture data-block used by this texture slot");
|
2020-10-30 12:12:25 +01:00
|
|
|
RNA_def_property_update(prop, NC_MATERIAL | ND_SHADING_LINKS, "rna_TextureSlotTexture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
|
2009-06-03 23:22:43 +00:00
|
|
|
RNA_def_property_string_funcs(
|
|
|
|
|
prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Name", "Texture slot name");
|
2009-06-03 23:22:43 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2009-06-03 23:22:43 +00:00
|
|
|
RNA_def_struct_name_property(srna, prop);
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-01-10 22:57:33 +00:00
|
|
|
/* mapping */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
|
2009-01-03 19:39:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ofs");
|
2012-04-10 08:33:30 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10, 10, 10, RNA_TRANSLATION_PREC_DEFAULT);
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Offset", "Fine tune of the texture mapping X, Y and Z locations");
|
2016-04-15 13:13:00 +02:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
|
2010-08-21 04:51:00 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "size");
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_PROPORTIONAL | PROP_CONTEXT_UPDATE);
|
2009-01-03 19:39:39 +00:00
|
|
|
RNA_def_property_ui_range(prop, -100, 100, 10, 2);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Size", "Set scaling for the texture's X, Y and Z sizes");
|
2016-04-15 13:13:00 +02:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
|
2009-01-03 21:10:48 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "r");
|
|
|
|
|
RNA_def_property_array(prop, 3);
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Color",
|
|
|
|
|
"Default color for textures that don't return RGB or when RGB to intensity is enabled");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
|
2009-01-10 22:57:33 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "blendtype");
|
2011-11-07 17:35:20 +00:00
|
|
|
RNA_def_property_enum_items(prop, blend_type_items);
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Blend Type", "Mode used to apply the texture");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE);
|
2009-01-03 21:10:48 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "def_var");
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2009-07-21 12:57:55 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0, 1, 10, 3);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Default Value",
|
|
|
|
|
"Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE);
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "which_output");
|
|
|
|
|
RNA_def_property_enum_items(prop, output_node_items);
|
2017-03-30 11:18:57 +02:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2009-08-18 19:58:27 +00:00
|
|
|
RNA_def_property_enum_funcs(
|
|
|
|
|
prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Output Node", "Which output node to use, for node-based textures");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_TextureSlot_update");
|
2009-01-03 08:08:44 +00:00
|
|
|
}
|
|
|
|
|
|
2012-03-18 09:27:36 +00:00
|
|
|
static void rna_def_filter_common(StructRNA *srna)
|
2009-04-09 20:33:39 +00:00
|
|
|
{
|
2009-04-10 18:03:24 +00:00
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE);
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP);
|
|
|
|
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set");
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "MIP Map", "Use auto-generated MIP maps for the image");
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE);
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP);
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps");
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE);
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "texfilter");
|
|
|
|
|
RNA_def_property_enum_items(prop, texture_filter_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-12 20:59:54 +10:00
|
|
|
prop = RNA_def_property(srna, "filter_lightprobes", PROP_INT, PROP_NONE);
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "afmax");
|
|
|
|
|
RNA_def_property_range(prop, 1, 256);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Filter Probes",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Maximum number of samples (higher gives less blur at distant/oblique angles, "
|
|
|
|
|
"but is also slower)");
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE);
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "afmax");
|
|
|
|
|
RNA_def_property_range(prop, 1, 256);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Filter Eccentricity",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Maximum eccentricity (higher gives less blur at distant/oblique angles, "
|
|
|
|
|
"but is also slower)");
|
2010-03-11 07:43:49 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN);
|
2009-11-02 09:31:55 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Minimum Filter Size", "Use Filter Size as a minimal filter value in pixels");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "filtersize");
|
|
|
|
|
RNA_def_property_range(prop, 0.1, 50.0);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 2);
|
2011-10-04 07:48:56 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Filter Size", "Multiply the filter size used by MIP Map and Interpolation");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_noise_basis_items[] = {
|
2011-09-19 13:23:58 +00:00
|
|
|
{TEX_BLENDER,
|
|
|
|
|
"BLENDER_ORIGINAL",
|
|
|
|
|
0,
|
|
|
|
|
"Blender Original",
|
|
|
|
|
"Noise algorithm - Blender original: Smooth interpolated noise"},
|
|
|
|
|
{TEX_STDPERLIN,
|
|
|
|
|
"ORIGINAL_PERLIN",
|
|
|
|
|
0,
|
|
|
|
|
"Original Perlin",
|
|
|
|
|
"Noise algorithm - Original Perlin: Smooth interpolated noise"},
|
|
|
|
|
{TEX_NEWPERLIN,
|
|
|
|
|
"IMPROVED_PERLIN",
|
|
|
|
|
0,
|
|
|
|
|
"Improved Perlin",
|
|
|
|
|
"Noise algorithm - Improved Perlin: Smooth interpolated noise"},
|
|
|
|
|
{TEX_VORONOI_F1,
|
|
|
|
|
"VORONOI_F1",
|
|
|
|
|
0,
|
|
|
|
|
"Voronoi F1",
|
|
|
|
|
"Noise algorithm - Voronoi F1: Returns distance to the closest feature point"},
|
|
|
|
|
{TEX_VORONOI_F2,
|
|
|
|
|
"VORONOI_F2",
|
|
|
|
|
0,
|
|
|
|
|
"Voronoi F2",
|
|
|
|
|
"Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"},
|
|
|
|
|
{TEX_VORONOI_F3,
|
|
|
|
|
"VORONOI_F3",
|
|
|
|
|
0,
|
|
|
|
|
"Voronoi F3",
|
|
|
|
|
"Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"},
|
|
|
|
|
{TEX_VORONOI_F4,
|
|
|
|
|
"VORONOI_F4",
|
|
|
|
|
0,
|
|
|
|
|
"Voronoi F4",
|
|
|
|
|
"Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"},
|
2011-05-15 17:59:48 +00:00
|
|
|
{TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", "Noise algorithm - Voronoi F1-F2"},
|
2011-09-19 13:23:58 +00:00
|
|
|
{TEX_VORONOI_CRACKLE,
|
|
|
|
|
"VORONOI_CRACKLE",
|
|
|
|
|
0,
|
|
|
|
|
"Voronoi Crackle",
|
|
|
|
|
"Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"},
|
|
|
|
|
{TEX_CELLNOISE,
|
|
|
|
|
"CELL_NOISE",
|
|
|
|
|
0,
|
|
|
|
|
"Cell Noise",
|
2011-10-20 07:56:04 +00:00
|
|
|
"Noise algorithm - Cell Noise: Square cell tessellation"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2009-03-23 11:10:07 +00:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_noise_type[] = {
|
2011-05-15 17:59:48 +00:00
|
|
|
{TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", "Generate soft noise (smooth transitions)"},
|
|
|
|
|
{TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", "Generate hard noise (sharp transitions)"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2009-03-25 14:42:47 +00:00
|
|
|
|
2009-03-23 11:10:07 +00:00
|
|
|
static void rna_def_texture_clouds(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_clouds_stype[] = {
|
2012-07-03 19:09:07 +00:00
|
|
|
{TEX_DEFAULT, "GRAYSCALE", 0, "Grayscale", ""},
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_COLOR, "COLOR", 0, "Color", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "CloudsTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture");
|
2009-03-23 11:10:07 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-03-23 11:10:07 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
|
2010-11-07 22:48:51 +00:00
|
|
|
RNA_def_property_range(prop, 0, 30);
|
2019-09-03 13:28:59 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 24, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_type);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Type", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_clouds_stype);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Color", "Determine whether Noise returns grayscale or RGB values");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-03-25 14:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture_wood(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_wood_stype[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_BAND, "BANDS", 0, "Bands", "Use standard wood texture in bands"},
|
|
|
|
|
{TEX_RING, "RINGS", 0, "Rings", "Use wood texture in rings"},
|
|
|
|
|
{TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Add noise to standard wood"},
|
|
|
|
|
{TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Add noise to rings"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_wood_noisebasis2[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_SIN, "SIN", 0, "Sine", "Use a sine wave to produce bands"},
|
|
|
|
|
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
|
|
|
|
|
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "WoodTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture");
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "turbul");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-03-23 11:10:07 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_type);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Type", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_wood_stype);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Pattern", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_wood_noisebasis2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-03-23 11:10:07 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-03-25 14:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture_marble(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_marble_stype[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_SOFT, "SOFT", 0, "Soft", "Use soft marble"},
|
|
|
|
|
{TEX_SHARP, "SHARP", 0, "Sharp", "Use more clearly defined marble"},
|
|
|
|
|
{TEX_SHARPER, "SHARPER", 0, "Sharper", "Use very clearly defined marble"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_marble_noisebasis2[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_SIN, "SIN", 0, "Sin", "Use a sine wave to produce bands"},
|
|
|
|
|
{TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"},
|
|
|
|
|
{TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MarbleTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture");
|
2009-03-25 18:21:48 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "turbul");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
|
2010-11-07 22:48:51 +00:00
|
|
|
RNA_def_property_range(prop, 0, 30);
|
2019-09-03 13:28:59 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 24, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_type);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Type", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_marble_stype);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Pattern", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-05-22 12:07:03 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_marble_noisebasis2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis 2", "");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-03-25 14:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture_magic(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MagicTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Magic Texture", "Procedural noise texture");
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "turbul");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "noisedepth");
|
2010-11-07 22:48:51 +00:00
|
|
|
RNA_def_property_range(prop, 0, 30);
|
2019-09-03 13:28:59 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 24, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the noise");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-03-25 14:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
static void rna_def_texture_blend(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_blend_progression[] = {
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_LIN, "LINEAR", 0, "Linear", "Create a linear progression"},
|
|
|
|
|
{TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Create a quadratic progression"},
|
|
|
|
|
{TEX_EASE, "EASING", 0, "Easing", "Create a progression easing from one step to the next"},
|
|
|
|
|
{TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"},
|
|
|
|
|
{TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Create a spherical progression"},
|
2012-03-18 09:27:36 +00:00
|
|
|
{TEX_HALO,
|
|
|
|
|
"QUADRATIC_SPHERE",
|
|
|
|
|
0,
|
2020-12-24 11:07:32 -06:00
|
|
|
"Quadratic Sphere",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Create a quadratic progression in the shape of a sphere"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
static const EnumPropertyItem prop_flip_axis_items[] = {
|
2011-11-26 12:30:01 +00:00
|
|
|
{0, "HORIZONTAL", 0, "Horizontal", "No flipping"},
|
|
|
|
|
{TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flip the texture's X and Y axis"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_blend_progression);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Progression", "Style of the color blending");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_flip_axis", PROP_ENUM, PROP_NONE);
|
2009-09-14 13:31:58 +00:00
|
|
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_flip_axis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
2009-03-25 14:42:47 +00:00
|
|
|
static void rna_def_texture_stucci(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_stucci_stype[] = {
|
2012-05-12 11:01:29 +00:00
|
|
|
{TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"},
|
2020-10-24 11:42:17 -07:00
|
|
|
{TEX_WALLIN, "WALL_IN", 0, "Wall In", "Create Dimples"},
|
|
|
|
|
{TEX_WALLOUT, "WALL_OUT", 0, "Wall Out", "Create Ridges"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "StucciTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture");
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "turbul");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-05-22 12:07:03 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisetype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_type);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Noise Type", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE);
|
2009-03-25 14:42:47 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_stucci_stype);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Pattern", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-03-23 11:10:07 +00:00
|
|
|
}
|
|
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
static void rna_def_texture_noise(BlenderRNA *brna)
|
2009-01-02 23:05:28 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "NoiseTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Noise Texture", "Procedural noise texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
|
|
|
|
}
|
2009-01-03 01:55:37 +00:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
static void rna_def_texture_image(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_image_extension[] = {
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"},
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_CLIPCUBE,
|
|
|
|
|
"CLIP_CUBE",
|
|
|
|
|
0,
|
|
|
|
|
"Clip Cube",
|
2011-11-26 12:30:01 +00:00
|
|
|
"Clip to cubic-shaped area around the image and set exterior pixels as transparent"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"},
|
|
|
|
|
{TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "ImageTexture", "Texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Image Texture", "");
|
2009-01-02 23:05:28 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_interpolation", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Interpolation", "Interpolate pixels using selected filter");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 02:48:05 +10:00
|
|
|
/* XXX: I think flip_axis should be a generic Texture property,
|
|
|
|
|
* enabled for all the texture types. */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-03-04 13:18:14 +00:00
|
|
|
prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Use Alpha", "Use the alpha channel information in the image");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_calculate_alpha", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Calculate Alpha", "Calculate an alpha channel based on RGB values in the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE);
|
2009-05-28 23:23:47 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Invert Alpha", "Invert all the alpha values in the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-03-11 07:43:49 +00:00
|
|
|
rna_def_filter_common(srna);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "extend");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_image_extension);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop, "Extension", "How the image is extrapolated past its original bounds");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "xrepeat");
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, 1, 512);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Repeat X", "Repetition multiplier in the X direction");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "yrepeat");
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, 1, 512);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Repeat Y", "Repetition multiplier in the Y direction");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Mirror X", "Mirror the image repetition on the X direction");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Mirror Y", "Mirror the image repetition on the Y direction");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_checker_odd", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Checker Odd", "Odd checker tiles");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_checker_even", PROP_BOOLEAN, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Checker Even", "Even checker tiles");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "checkerdist");
|
|
|
|
|
RNA_def_property_range(prop, 0.0, 0.99);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Checker Distance", "Distance between checker tiles");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-03-23 11:08:01 +00:00
|
|
|
# if 0
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
/* XXX: did this as an array, but needs better descriptions than "1 2 3 4"
|
2012-04-22 11:54:53 +00:00
|
|
|
* perhaps a new subtype could be added?
|
|
|
|
|
* --I actually used single values for this, maybe change later with a RNA_Rect thing? */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
|
|
|
|
|
RNA_def_property_array(prop, 4);
|
|
|
|
|
RNA_def_property_range(prop, -10, 10);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Crop Rectangle", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
# endif
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "crop_min_x", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cropxmin");
|
|
|
|
|
RNA_def_property_range(prop, -10.0, 10.0);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Crop Minimum X", "Minimum X value to crop the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cropymin");
|
|
|
|
|
RNA_def_property_range(prop, -10.0, 10.0);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Crop Minimum Y", "Minimum Y value to crop the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cropxmax");
|
|
|
|
|
RNA_def_property_range(prop, -10.0, 10.0);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Crop Maximum X", "Maximum X value to crop the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "cropymax");
|
|
|
|
|
RNA_def_property_range(prop, -10.0, 10.0);
|
2012-04-07 15:46:26 +00:00
|
|
|
RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Crop Maximum Y", "Maximum Y value to crop the image");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "ima");
|
|
|
|
|
RNA_def_property_struct_type(prop, "Image");
|
2009-05-28 23:23:47 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE);
|
2019-08-20 17:48:10 +02:00
|
|
|
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Image", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL);
|
2009-09-16 19:27:08 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "iuser");
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Image User",
|
|
|
|
|
"Parameters defining which layer, pass and frame of the image is displayed");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-10-29 14:27:56 +00:00
|
|
|
/* Normal Map */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_normal_map", PROP_BOOLEAN, PROP_NONE);
|
2009-10-29 14:27:56 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Normal Map", "Use image RGB values for normal mapping");
|
2009-10-29 14:27:56 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture_musgrave(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_musgrave_type[] = {
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Use Perlin noise as a basis"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_RIDGEDMF,
|
|
|
|
|
"RIDGED_MULTIFRACTAL",
|
|
|
|
|
0,
|
|
|
|
|
"Ridged Multifractal",
|
2011-11-26 12:30:01 +00:00
|
|
|
"Use Perlin noise with inflection as a basis"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_HYBRIDMF,
|
|
|
|
|
"HYBRID_MULTIFRACTAL",
|
|
|
|
|
0,
|
|
|
|
|
"Hybrid Multifractal",
|
2011-11-26 12:30:01 +00:00
|
|
|
"Use Perlin noise as a basis, with extended controls"},
|
|
|
|
|
{TEX_FBM, "FBM", 0, "fBM", "Fractal Brownian Motion, use Brownian noise as a basis"},
|
|
|
|
|
{TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Similar to multifractal"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MusgraveTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "stype");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_musgrave_type);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Type", "Fractal noise algorithm");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "dimension_max", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mg_H");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity");
|
|
|
|
|
RNA_def_property_range(prop, 0, 6);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 6, 1, 2);
|
2010-05-04 05:15:53 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Lacunarity", "Gap between successive frequencies");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mg_octaves");
|
|
|
|
|
RNA_def_property_range(prop, 0, 8);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 8, 1, 2);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mg_offset");
|
|
|
|
|
RNA_def_property_range(prop, 0, 6);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 6, 1, 2);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Offset", "The fractal offset");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "mg_gain");
|
|
|
|
|
RNA_def_property_range(prop, 0, 6);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 6, 1, 2);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Gain", "The gain multiplier");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
|
|
|
|
|
RNA_def_property_range(prop, 0, 10);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 10, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Intensity", "Intensity of the noise");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture_voronoi(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_distance_metric_items[] = {
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "sqrt(x*x+y*y+z*z)"},
|
|
|
|
|
{TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "(x*x+y*y+z*z)"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_MANHATTAN,
|
|
|
|
|
"MANHATTAN",
|
|
|
|
|
0,
|
|
|
|
|
"Manhattan",
|
2011-11-26 12:30:01 +00:00
|
|
|
"The length of the distance in axial directions"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", "The length of the longest Axial journey"},
|
2012-07-17 18:14:59 +00:00
|
|
|
{TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkowski 1/2", "Set Minkowski variable to 0.5"},
|
|
|
|
|
{TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkowski 4", "Set Minkowski variable to 4"},
|
|
|
|
|
{TEX_MINKOVSKY,
|
|
|
|
|
"MINKOVSKY",
|
|
|
|
|
0,
|
|
|
|
|
"Minkowski",
|
|
|
|
|
"Use the Minkowski function to calculate distance "
|
2011-09-28 14:08:56 +00:00
|
|
|
"(exponent value determines the shape of the boundaries)"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem prop_coloring_items[] = {
|
2009-04-09 20:33:39 +00:00
|
|
|
/* XXX: OK names / descriptions? */
|
2010-02-11 01:11:52 +00:00
|
|
|
{TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"},
|
|
|
|
|
{TEX_COL1, "POSITION", 0, "Position", "Color cells by position"},
|
2011-11-26 12:30:01 +00:00
|
|
|
{TEX_COL2,
|
|
|
|
|
"POSITION_OUTLINE",
|
|
|
|
|
0,
|
|
|
|
|
"Position and Outline",
|
|
|
|
|
"Use position plus an outline based on F2-F1"},
|
2011-09-28 14:08:56 +00:00
|
|
|
{TEX_COL3,
|
|
|
|
|
"POSITION_OUTLINE_INTENSITY",
|
|
|
|
|
0,
|
|
|
|
|
"Position, Outline, and Intensity",
|
|
|
|
|
"Multiply position and outline by intensity"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "VoronoiTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vn_w1");
|
|
|
|
|
RNA_def_property_range(prop, -2, 2);
|
2009-08-08 14:17:55 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE);
|
2009-08-08 14:17:55 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vn_w2");
|
|
|
|
|
RNA_def_property_range(prop, -2, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE);
|
2009-08-08 14:17:55 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vn_w3");
|
|
|
|
|
RNA_def_property_range(prop, -2, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE);
|
2009-08-08 14:17:55 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vn_w4");
|
|
|
|
|
RNA_def_property_range(prop, -2, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "vn_mexp");
|
|
|
|
|
RNA_def_property_range(prop, 0.01, 10);
|
2012-07-17 18:14:59 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Minkowski Exponent", "Minkowski exponent");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "vn_distm");
|
|
|
|
|
RNA_def_property_enum_items(prop, prop_distance_metric_items);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(
|
|
|
|
|
prop,
|
|
|
|
|
"Distance Metric",
|
|
|
|
|
"Algorithm used to calculate distance of sample points to feature points");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE);
|
2009-01-03 01:55:37 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "vn_coltype");
|
2009-05-26 02:49:46 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_coloring_items);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Coloring", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "ns_outscale");
|
2009-04-12 17:28:41 +00:00
|
|
|
RNA_def_property_range(prop, 0.01, 10);
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
2009-01-03 05:18:11 +00:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
static void rna_def_texture_distorted_noise(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "DistortedNoiseTexture", "Texture");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "dist_amount");
|
|
|
|
|
RNA_def_property_range(prop, 0, 10);
|
2011-05-15 17:59:48 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Distortion Amount", "Amount of distortion");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "noisesize");
|
|
|
|
|
RNA_def_property_range(prop, 0.0001, FLT_MAX);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0.0001, 2, 1, 2);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE);
|
2009-08-20 17:59:37 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis2");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE);
|
2009-08-20 17:59:37 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "noisebasis");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_enum_items(prop, prop_noise_basis_items);
|
2011-11-26 12:30:01 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Noise Distortion", "Noise basis for the distortion");
|
2009-12-05 21:14:31 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_range(prop, 0.001, 0.1);
|
|
|
|
|
RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2009-04-09 20:33:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void rna_def_texture(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
PropertyRNA *prop;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "Texture", "ID");
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Tex");
|
2018-06-27 14:41:53 +02:00
|
|
|
RNA_def_struct_ui_text(
|
|
|
|
|
srna, "Texture", "Texture data-block used by materials, lights, worlds and brushes");
|
2009-06-03 23:16:51 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_struct_refine_func(srna, "rna_Texture_refine");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
|
|
|
|
/*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
|
2009-08-03 10:54:02 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "type");
|
2015-11-23 13:49:52 +11:00
|
|
|
RNA_def_property_enum_items(prop, rna_enum_texture_type_items);
|
2009-08-13 05:21:25 +00:00
|
|
|
RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Type", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-01-23 18:38:48 +01:00
|
|
|
prop = RNA_def_property(srna, "use_clamp", PROP_BOOLEAN, PROP_NONE);
|
|
|
|
|
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", TEX_NO_CLAMP);
|
|
|
|
|
RNA_def_property_ui_text(prop,
|
|
|
|
|
"Clamp",
|
|
|
|
|
"Set negative texture RGB and intensity values to zero, for some uses "
|
|
|
|
|
"like displacement this option can be disabled to get the full range");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE);
|
2009-07-21 12:57:55 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND);
|
|
|
|
|
RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set");
|
2020-05-21 23:03:24 +10:00
|
|
|
RNA_def_property_ui_text(prop,
|
|
|
|
|
"Use Color Ramp",
|
|
|
|
|
"Map the texture intensity to the color ramp. "
|
|
|
|
|
"Note that the alpha value is used for image textures, "
|
|
|
|
|
"enable \"Calculate Alpha\" for images without an alpha channel");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "coba");
|
|
|
|
|
RNA_def_property_struct_type(prop, "ColorRamp");
|
|
|
|
|
RNA_def_property_ui_text(prop, "Color Ramp", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bright");
|
|
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE);
|
2013-01-14 20:27:25 +00:00
|
|
|
RNA_def_property_range(prop, 0.0, 5);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 5, 1, 3);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE);
|
2010-07-05 10:18:59 +00:00
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2011-09-28 14:08:56 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture");
|
2010-07-05 10:18:59 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-10-05 15:59:12 +00:00
|
|
|
/* RGB Factor */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE);
|
2009-04-09 20:33:39 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "rfac");
|
|
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2009-10-05 15:59:12 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Factor Red", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE);
|
2009-10-05 15:59:12 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "gfac");
|
|
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2009-10-05 15:59:12 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Factor Green", "");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE);
|
2009-10-05 15:59:12 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "bfac");
|
|
|
|
|
RNA_def_property_range(prop, 0, 2);
|
2019-09-05 16:29:35 +02:00
|
|
|
RNA_def_property_ui_range(prop, 0, 2, 1, 3);
|
2009-10-05 15:59:12 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Factor Blue", "");
|
Sorry, three commits in one, became difficult to untangle..
Editors Modules
* render/ module added in editors, moved the preview render code there and
also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
making a single physics_ops.c for operators and keymaps. Also move all
particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
specificially.
Updates & Notifiers
* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
which will go back to a callback in editors. Eventually these should
be in the depsgraph itself, but for now this gives a unified call for
doing updates.
* GLSL materials are now refreshed on changes. There's still various
cases missing,
* Preview icons now hook into this system, solving various update cases
that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
problem is avoided in the new system.
Icon Rendering
* On systems with support for non-power of two textures, an OpenGL texture
is now used instead of glDrawPixels. This avoids problems with icons get
clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
with the default setup. The glDrawPixels implementation on Mac seems to
have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
be used with threads reliably.
2009-09-29 19:12:12 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-04-04 12:09:59 +00:00
|
|
|
/* Alpha for preview render */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE);
|
2010-04-04 12:09:59 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA);
|
|
|
|
|
RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render");
|
|
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-08-17 18:37:58 +00:00
|
|
|
/* nodetree */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
|
2013-03-18 16:34:57 +00:00
|
|
|
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture");
|
2013-03-18 16:34:57 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_use_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
|
2020-06-26 18:25:28 +02:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP);
|
2009-08-17 18:37:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures");
|
2009-10-07 14:48:29 +00:00
|
|
|
RNA_def_property_update(prop, 0, "rna_Texture_nodes_update");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
rna_def_animdata_common(srna);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-04-09 20:33:39 +00:00
|
|
|
/* specific types */
|
|
|
|
|
rna_def_texture_clouds(brna);
|
|
|
|
|
rna_def_texture_wood(brna);
|
|
|
|
|
rna_def_texture_marble(brna);
|
|
|
|
|
rna_def_texture_magic(brna);
|
|
|
|
|
rna_def_texture_blend(brna);
|
|
|
|
|
rna_def_texture_stucci(brna);
|
|
|
|
|
rna_def_texture_noise(brna);
|
|
|
|
|
rna_def_texture_image(brna);
|
|
|
|
|
rna_def_texture_musgrave(brna);
|
|
|
|
|
rna_def_texture_voronoi(brna);
|
|
|
|
|
rna_def_texture_distorted_noise(brna);
|
|
|
|
|
/* XXX add more types here .. */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-09-06 10:49:55 +00:00
|
|
|
RNA_api_texture(srna);
|
2009-03-23 11:08:01 +00:00
|
|
|
}
|
2009-01-03 05:18:11 +00:00
|
|
|
|
2009-03-23 11:08:01 +00:00
|
|
|
void RNA_def_texture(BlenderRNA *brna)
|
|
|
|
|
{
|
|
|
|
|
rna_def_texture(brna);
|
2009-01-10 22:57:33 +00:00
|
|
|
rna_def_mtex(brna);
|
2009-03-24 17:40:58 +00:00
|
|
|
rna_def_texmapping(brna);
|
2011-11-07 17:35:20 +00:00
|
|
|
rna_def_colormapping(brna);
|
2009-01-02 23:05:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|