Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_uvproject.c')
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 580a065f35e..07a57806f87 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -28,17 +28,28 @@
#include "BLI_math.h"
#include "BLI_uvproject.h"
+#include "BLT_translation.h"
+
#include "DNA_camera_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
+#include "DNA_screen_types.h"
#include "BKE_camera.h"
+#include "BKE_context.h"
#include "BKE_lib_query.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
+#include "BKE_screen.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+#include "RNA_access.h"
#include "MOD_modifiertypes.h"
+#include "MOD_ui_common.h"
#include "MEM_guardedalloc.h"
@@ -313,6 +324,43 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
return result;
}
+static void panel_draw(const bContext *C, Panel *panel)
+{
+ uiLayout *sub;
+ uiLayout *layout = panel->layout;
+
+ PointerRNA ptr;
+ PointerRNA ob_ptr;
+ modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr);
+
+ PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data");
+
+ uiLayoutSetPropSep(layout, true);
+
+ uiItemPointerR(layout, &ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE);
+
+ sub = uiLayoutColumn(layout, true);
+ uiItemR(sub, &ptr, "aspect_x", 0, IFACE_("Aspect X"), ICON_NONE);
+ uiItemR(sub, &ptr, "aspect_y", 0, IFACE_("Y"), ICON_NONE);
+
+ sub = uiLayoutColumn(layout, true);
+ uiItemR(sub, &ptr, "scale_x", 0, IFACE_("Scale X"), ICON_NONE);
+ uiItemR(sub, &ptr, "scale_y", 0, IFACE_("Y"), ICON_NONE);
+
+ uiItemR(layout, &ptr, "projector_count", 0, IFACE_("Projectors"), ICON_NONE);
+ RNA_BEGIN (&ptr, projector_ptr, "projectors") {
+ uiItemR(layout, &projector_ptr, "object", 0, NULL, ICON_NONE);
+ }
+ RNA_END;
+
+ modifier_panel_end(layout, &ptr);
+}
+
+static void panelRegister(ARegionType *region_type)
+{
+ modifier_panel_register(region_type, eModifierType_UVProject, panel_draw);
+}
+
ModifierTypeInfo modifierType_UVProject = {
/* name */ "UVProject",
/* structName */ "UVProjectModifierData",
@@ -343,4 +391,5 @@ ModifierTypeInfo modifierType_UVProject = {
/* foreachIDLink */ foreachIDLink,
/* foreachTexLink */ NULL,
/* freeRuntimeData */ NULL,
+ /* panelRegister */ panelRegister,
};