~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/python/bmesh/bmesh_py_types.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
 
123
123
        param = PyLong_AsLong(value);
124
124
 
125
 
        if (param == true) {
126
 
                BM_elem_flag_enable(self->ele, hflag);
127
 
                return 0;
128
 
        }
129
 
        else if (param == false) {
130
 
                BM_elem_flag_disable(self->ele, hflag);
 
125
        if ((unsigned int)param <= 1) {
 
126
                if (hflag == BM_ELEM_SELECT)
 
127
                        BM_elem_select_set(self->bm, self->ele, param);
 
128
                else
 
129
                        BM_elem_flag_set(self->ele, hflag, param);
 
130
 
131
131
                return 0;
132
132
        }
133
133
        else {
1047
1047
        int use_shape_key = false;
1048
1048
        int shape_key_index = 0;
1049
1049
 
 
1050
        BPY_BM_CHECK_OBJ(self);
 
1051
 
1050
1052
        if (!PyArg_ParseTupleAndKeywords(args, kw, "O|iii:from_mesh", (char **)kwlist,
1051
1053
                                         &py_mesh, &use_fnorm, &use_shape_key, &shape_key_index) ||
1052
1054
            !(me = PyC_RNA_AsPointer(py_mesh, "Mesh")))
1871
1873
                        return NULL;
1872
1874
                }
1873
1875
 
1874
 
                v = BM_vert_create(bm, co, NULL, 0);
 
1876
                v = BM_vert_create(bm, co, NULL, BM_CREATE_NOP);
1875
1877
 
1876
1878
                if (v == NULL) {
1877
1879
                        PyErr_SetString(PyExc_ValueError,
1940
1942
                        goto cleanup;
1941
1943
                }
1942
1944
 
1943
 
                e = BM_edge_create(bm, vert_array[0], vert_array[1], NULL, 0);
 
1945
                e = BM_edge_create(bm, vert_array[0], vert_array[1], NULL, BM_CREATE_NOP);
1944
1946
 
1945
1947
                if (e == NULL) {
1946
1948
                        PyErr_SetString(PyExc_ValueError,
2020
2022
                /* Go ahead and make the face!
2021
2023
                 * --------------------------- */
2022
2024
 
2023
 
                f_new = BM_face_create_ngon_verts(bm, vert_array, vert_seq_len, 0, false, true);
 
2025
                f_new = BM_face_create_verts(bm, vert_array, vert_seq_len,
 
2026
                                             py_face_example ? py_face_example->f : NULL, BM_CREATE_NOP, true);
2024
2027
 
2025
2028
                if (UNLIKELY(f_new == NULL)) {
2026
2029
                        PyErr_SetString(PyExc_ValueError,
2028
2031
                        goto cleanup;
2029
2032
                }
2030
2033
 
2031
 
                if (py_face_example) {
2032
 
                        BM_elem_attrs_copy(py_face_example->bm, bm, py_face_example->f, f_new);
2033
 
                }
2034
 
 
2035
2034
                ret = BPy_BMFace_CreatePyObject(bm, f_new);
2036
2035
 
2037
2036
                /* pass through */
2921
2920
        BMesh *bm = self->bm;
2922
2921
        if (bm) {
2923
2922
                void **ptr = CustomData_bmesh_get(&bm->vdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
2924
 
                *ptr = NULL;
 
2923
                if (ptr)
 
2924
                        *ptr = NULL;
2925
2925
        }
2926
2926
        PyObject_DEL(self);
2927
2927
}
2931
2931
        BMesh *bm = self->bm;
2932
2932
        if (bm) {
2933
2933
                void **ptr = CustomData_bmesh_get(&bm->edata, self->ele->head.data, CD_BM_ELEM_PYPTR);
2934
 
                *ptr = NULL;
 
2934
                if (ptr)
 
2935
                        *ptr = NULL;
2935
2936
        }
2936
2937
        PyObject_DEL(self);
2937
2938
}
2941
2942
        BMesh *bm = self->bm;
2942
2943
        if (bm) {
2943
2944
                void **ptr = CustomData_bmesh_get(&bm->pdata, self->ele->head.data, CD_BM_ELEM_PYPTR);
2944
 
                *ptr = NULL;
 
2945
                if (ptr)
 
2946
                        *ptr = NULL;
2945
2947
        }
2946
2948
        PyObject_DEL(self);
2947
2949
}
2951
2953
        BMesh *bm = self->bm;
2952
2954
        if (bm) {
2953
2955
                void **ptr = CustomData_bmesh_get(&bm->ldata, self->ele->head.data, CD_BM_ELEM_PYPTR);
2954
 
                *ptr = NULL;
 
2956
                if (ptr)
 
2957
                        *ptr = NULL;
2955
2958
        }
2956
2959
        PyObject_DEL(self);
2957
2960
}