[Bf-blender-cvs] [a6b125b06fd] blender2.8: Remove unused files

mano-wii noreply at git.blender.org
Mon Sep 24 19:50:31 CEST 2018


Commit: a6b125b06fd50c25bee5b4e26fbfe3ce0badca03
Author: mano-wii
Date:   Mon Sep 24 14:50:20 2018 -0300
Branches: blender2.8
https://developer.blender.org/rBa6b125b06fd50c25bee5b4e26fbfe3ce0badca03

Remove unused files

===================================================================

D	source/blender/python/intern/gpu.c
D	source/blender/python/intern/gpu_offscreen.c

===================================================================

diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c
deleted file mode 100644
index 71143585657..00000000000
--- a/source/blender/python/intern/gpu.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2006 Blender Foundation.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Benoit Bolsee.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/python/intern/gpu.c
- *  \ingroup pythonintern
- *
- * This file defines the 'gpu' module, used to get GLSL shader code and data
- * from blender materials.
- */
-
-#include <Python.h>
-
-#include "DNA_scene_types.h"
-#include "DNA_material_types.h"
-#include "DNA_ID.h"
-#include "DNA_customdata_types.h"
-
-#include "BLI_listbase.h"
-#include "BLI_utildefines.h"
-
-#include "RNA_access.h"
-
-#include "bpy_rna.h"
-
-#include "../generic/py_capi_utils.h"
-
-#include "GPU_material.h"
-
-#include "gpu.h"
-
-#define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, # name, name)
-
-PyDoc_STRVAR(M_gpu_doc,
-"This module provides access to GPU offscreen rendering, matrix stacks and selection."
-);
-static struct PyModuleDef gpumodule = {
-	PyModuleDef_HEAD_INIT,
-	"gpu",     /* name of module */
-	M_gpu_doc, /* module documentation */
-	-1,        /* size of per-interpreter state of the module,
-	            * or -1 if the module keeps state in global variables. */
-	NULL, NULL, NULL, NULL, NULL
-};
-
-static PyObject *PyInit_gpu(void)
-{
-	PyObject *m;
-
-	m = PyModule_Create(&gpumodule);
-	if (m == NULL)
-		return NULL;
-
-	/* Take care to update docs when editing: 'doc/python_api/rst/gpu.rst' */
-	return m;
-}
-
-/* -------------------------------------------------------------------- */
-/* Initialize Module */
-
-PyObject *GPU_initPython(void)
-{
-	PyObject *module;
-	PyObject *submodule;
-	PyObject *sys_modules = PyImport_GetModuleDict();
-
-	module = PyInit_gpu();
-
-	/* gpu.offscreen */
-	PyModule_AddObject(module, "offscreen", (submodule = BPyInit_gpu_offscreen()));
-	PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
-	Py_INCREF(submodule);
-
-	PyModule_AddObject(module, "matrix", (submodule = BPyInit_gpu_matrix()));
-	PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
-	Py_INCREF(submodule);
-
-	PyModule_AddObject(module, "select", (submodule = BPyInit_gpu_select()));
-	PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
-	Py_INCREF(submodule);
-
-	PyDict_SetItem(PyImport_GetModuleDict(), PyModule_GetNameObject(module), module);
-	return module;
-}
diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c
deleted file mode 100644
index 73a571b647e..00000000000
--- a/source/blender/python/intern/gpu_offscreen.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Copyright 2015, Blender Foundation.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/python/intern/gpu_offscreen.c
- *  \ingroup pythonintern
- *
- * This file defines the offscreen functionalities of the 'gpu' module
- * used for off-screen OpenGL rendering.
- */
-
-#include <Python.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_utildefines.h"
-
-#include "WM_types.h"
-
-#include "BKE_global.h"
-#include "BKE_library.h"
-#include "BKE_scene.h"
-
-#include "ED_screen.h"
-
-#include "GPU_framebuffer.h"
-#include "GPU_texture.h"
-
-#include "../mathutils/mathutils.h"
-
-#include "../generic/py_capi_utils.h"
-
-#include "gpu.h"
-
-#include "ED_view3d.h"
-
-/* -------------------------------------------------------------------- */
-/* GPU Offscreen PyObject */
-
-typedef struct {
-	PyObject_HEAD
-	GPUOffScreen *ofs;
-} BPy_GPUOffScreen;
-
-static int bpy_gpu_offscreen_valid_check(BPy_GPUOffScreen *py_gpu_ofs)
-{
-	if (UNLIKELY(py_gpu_ofs->ofs == NULL)) {
-		PyErr_SetString(PyExc_ReferenceError, "GPU offscreen was freed, no further access is valid");
-		return -1;
-	}
-	return 0;
-}
-
-#define BPY_GPU_OFFSCREEN_CHECK_OBJ(pygpu) { \
-	if (UNLIKELY(bpy_gpu_offscreen_valid_check(pygpu) == -1)) { \
-		return NULL; \
-	} \
-} ((void)0)
-
-PyDoc_STRVAR(pygpu_offscreen_width_doc, "Texture width.\n\n:type: int");
-static PyObject *pygpu_offscreen_width_get(BPy_GPUOffScreen *self, void *UNUSED(type))
-{
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-	return PyLong_FromLong(GPU_offscreen_width(self->ofs));
-}
-
-PyDoc_STRVAR(pygpu_offscreen_height_doc, "Texture height.\n\n:type: int");
-static PyObject *pygpu_offscreen_height_get(BPy_GPUOffScreen *self, void *UNUSED(type))
-{
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-	return PyLong_FromLong(GPU_offscreen_height(self->ofs));
-}
-
-PyDoc_STRVAR(pygpu_offscreen_color_texture_doc, "Color texture.\n\n:type: int");
-static PyObject *pygpu_offscreen_color_texture_get(BPy_GPUOffScreen *self, void *UNUSED(type))
-{
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-	GPUTexture *texture = GPU_offscreen_color_texture(self->ofs);
-	return PyLong_FromLong(GPU_texture_opengl_bindcode(texture));
-}
-
-PyDoc_STRVAR(pygpu_offscreen_bind_doc,
-"bind(save=True)\n"
-"\n"
-"   Bind the offscreen object.\n"
-"\n"
-"   :param save: save OpenGL current states.\n"
-"   :type save: bool\n"
-);
-static PyObject *pygpu_offscreen_bind(BPy_GPUOffScreen *self, PyObject *args, PyObject *kwds)
-{
-	static const char *kwlist[] = {"save", NULL};
-	bool save = true;
-
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-
-	if (!PyArg_ParseTupleAndKeywords(
-	        args, kwds, "|O&:bind", (char **)(kwlist),
-	        PyC_ParseBool, &save))
-	{
-		return NULL;
-	}
-
-	GPU_offscreen_bind(self->ofs, save);
-	Py_RETURN_NONE;
-}
-
-PyDoc_STRVAR(pygpu_offscreen_unbind_doc,
-"unbind(restore=True)\n"
-"\n"
-"   Unbind the offscreen object.\n"
-"\n"
-"   :param restore: restore OpenGL previous states.\n"
-"   :type restore: bool\n"
-);
-static PyObject *pygpu_offscreen_unbind(BPy_GPUOffScreen *self, PyObject *args, PyObject *kwds)
-{
-	static const char *kwlist[] = {"restore", NULL};
-	bool restore = true;
-
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-
-	if (!PyArg_ParseTupleAndKeywords(
-	        args, kwds, "|O&:unbind", (char **)(kwlist),
-	        PyC_ParseBool, &restore))
-	{
-		return NULL;
-	}
-
-	GPU_offscreen_unbind(self->ofs, restore);
-	Py_RETURN_NONE;
-}
-
-PyDoc_STRVAR(pygpu_offscreen_draw_view3d_doc,
-"draw_view3d(scene, view3d, region, modelview_matrix, projection_matrix)\n"
-"\n"
-"   Draw the 3d viewport in the offscreen object.\n"
-"\n"
-"   :param scene: Scene to draw.\n"
-"   :type scene: :class:`bpy.types.Scene`\n"
-"   :param view3d: 3D View to get the drawing settings from.\n"
-"   :type view3d: :class:`bpy.types.SpaceView3D`\n"
-"   :param region: Region of the 3D View.\n"
-"   :type region: :class:`bpy.types.Region`\n"
-"   :param modelview_matrix: ModelView Matrix.\n"
-"   :type modelview_matrix: :class:`mathutils.Matrix`\n"
-"   :param projection_matrix: Projection Matrix.\n"
-"   :type projection_matrix: :class:`mathutils.Matrix`\n"
-);
-static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *args, PyObject *kwds)
-{
-	static const char *kwlist[] = {"scene", "view_layer", "view3d", "region", "projection_matrix", "modelview_matrix", NULL};
-
-	MatrixObject *py_mat_modelview, *py_mat_projection;
-	PyObject *py_scene, *py_view_layer, *py_region, *py_view3d;
-
-	Scene *scene;
-	ViewLayer *view_layer;
-	View3D *v3d;
-	ARegion *ar;
-	struct RV3DMatrixStore *rv3d_mats;
-
-	BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
-
-	if (!PyArg_ParseTupleAndKeywords(
-	        args, kwds, "OOOOO&O&:draw_view3d", (char **)(kwlist),
-	        &py_scene, &py_view_layer, &py_view3d, &py_region,
-	        Matrix_Parse4x4, &py_mat_projection,
-	        Matrix_Parse4x4, &py_mat_modelview) ||
-	    (!(scene       = PyC_RNA_AsPointer(py_scene, "Scene")) ||
-	     !(view_layer = PyC_RNA_AsPointer(py_view_layer, "ViewLayer")) ||
-	     !(v3d         = PyC_RNA_AsPointer(py_view3d, "SpaceView3D")) ||
-	     !(ar          = PyC_RNA_AsPointer(py_region, "Region"))))
-	{
-		return NULL;
-	}
-
-	BLI_assert(BKE_id_is_in_gobal_main(&scene->id));
-
-	rv3d_mats = ED_view3d_mats_rv3d_backup(ar->regiondata);
-
-	GPU_offscreen_bind(self->ofs, true); /* bind */
-
-	struct Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
-
-	ED_view3d_draw_offscreen(depsgraph,
-	                         scene,
-	                         v3d->shading.type,
-	                         v3d,
-	                         ar,
-	                         GPU_offscreen_width(self->ofs),
-	                         GPU_offscreen_height(self->ofs),
-	                         (float(*)[4])py_mat_modelview->matrix,
-	        

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list