Merging r49451 through r49462 from trunk into soc-2011-tomato
This commit is contained in:
@@ -209,7 +209,7 @@ void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height, doub
|
||||
if( ix >= width-2 ) ix = width-2;
|
||||
if( iy >= height-2 ) iy = height-2;
|
||||
|
||||
Offset offset = { ix-x, iy-y, fx, fy };
|
||||
Offset offset = { (short)(ix-x), (short)(iy-y), (unsigned char)fx, (unsigned char)fy };
|
||||
grid->offset[y*width+x] = offset;
|
||||
}
|
||||
}
|
||||
|
||||
4
extern/libmv/libmv/simple_pipeline/detect.cc
vendored
4
extern/libmv/libmv/simple_pipeline/detect.cc
vendored
@@ -66,7 +66,7 @@ std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height
|
||||
Feature *all_features = new Feature[num_features];
|
||||
|
||||
for(int i = 0; i < num_features; ++i) {
|
||||
Feature a = { nonmax[i].x, nonmax[i].y, scores[i], 0 };
|
||||
Feature a = { (float)nonmax[i].x, (float)nonmax[i].y, (float)scores[i], 0 };
|
||||
all_features[i] = a;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* det
|
||||
for(int y=16; y<height-16; y++) {
|
||||
for(int x=16; x<width-16; x++) {
|
||||
int s = scores[y*width+x];
|
||||
Feature f = { x+8, y+8, s, 16 };
|
||||
Feature f = { (float)x+8.0f, (float)y+8.0f, (float)s, 16 };
|
||||
if(s>min) detected[i++] = f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,15 +301,12 @@ public:
|
||||
{
|
||||
string build_options = " -cl-fast-relaxed-math ";
|
||||
|
||||
/* Multi Closure for nVidia cards */
|
||||
if(platform_name == "NVIDIA CUDA")
|
||||
build_options += "-D__KERNEL_SHADING__ -D__KERNEL_OPENCL_NVIDIA__ -cl-nv-maxrregcount=24 -cl-nv-verbose ";
|
||||
|
||||
/* No Float3 for Apple */
|
||||
|
||||
else if(platform_name == "Apple")
|
||||
build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_APPLE__ ";
|
||||
|
||||
/* Basic shading for AMD cards (non Apple) */
|
||||
|
||||
else if(platform_name == "AMD Accelerated Parallel Processing")
|
||||
build_options += "-D__CL_NO_FLOAT3__ -D__KERNEL_OPENCL_AMD__ ";
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ void MEM_printmemlist_pydict(void)
|
||||
MEM_printmemlist_internal(1);
|
||||
}
|
||||
|
||||
short MEM_freeN(void *vmemh) /* anders compileertie niet meer */
|
||||
short MEM_freeN(void *vmemh)
|
||||
{
|
||||
short error = 0;
|
||||
MemTail *memt;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BilateralBlurNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_BilateralBlurOperation.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BlurNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "COM_GaussianXBlurOperation.h"
|
||||
#include "COM_GaussianYBlurOperation.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BokehBlurNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_camera_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BokehImageNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_BokehImageOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BoxMaskNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_BoxMaskOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_BrightnessNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_BrightnessOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_ColorCorrectionNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ColorCorrectionOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_ColorCurveNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ColorCurveOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_ColorNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_SetColorOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte
|
||||
InputSocket *depthSocket = this->getInputSocket(2);
|
||||
|
||||
CompositorOperation *compositorOperation = new CompositorOperation();
|
||||
compositorOperation->setScene((Scene *) editorNode->id);
|
||||
compositorOperation->setSceneName(editorNode->id->name);
|
||||
compositorOperation->setRenderData(context->getRenderData());
|
||||
compositorOperation->setbNodeTree(context->getbNodeTree());
|
||||
imageSocket->relinkConnections(compositorOperation->getInputSocket(0), 0, graph);
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_DilateErodeNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_DilateErodeOperation.h"
|
||||
#include "COM_AntiAliasOperation.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_DirectionalBlurNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_DirectionalBlurOperation.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "COM_DoubleEdgeMaskNode.h"
|
||||
#include "COM_DoubleEdgeMaskOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
DoubleEdgeMaskNode::DoubleEdgeMaskNode(bNode *editorNode) : Node(editorNode)
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_EllipseMaskNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_EllipseMaskOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_GammaNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_GammaOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_IDMaskNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_IDMaskOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_AntiAliasOperation.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_InvertNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_InvertOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "BKE_node.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_LensDistortionNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_ProjectorLensDistortionOperation.h"
|
||||
#include "COM_ScreenLensDistortionOperation.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_TimeNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_SetValueOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
extern "C" {
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_TonemapNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_TonemapOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_ValueNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_SetValueOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_VectorCurveNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_VectorCurveOperation.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
*/
|
||||
|
||||
#include "COM_ViewLevelsNode.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "COM_ExecutionSystem.h"
|
||||
#include "COM_CalculateMeanOperation.h"
|
||||
#include "COM_CalculateStandardDeviationOperation.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_CompositorOperation.h"
|
||||
#include "COM_SocketConnection.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -49,6 +48,8 @@ CompositorOperation::CompositorOperation() : NodeOperation()
|
||||
this->m_imageInput = NULL;
|
||||
this->m_alphaInput = NULL;
|
||||
this->m_depthInput = NULL;
|
||||
|
||||
this->m_sceneName[0] = '\0';
|
||||
}
|
||||
|
||||
void CompositorOperation::initExecution()
|
||||
@@ -68,7 +69,7 @@ void CompositorOperation::initExecution()
|
||||
void CompositorOperation::deinitExecution()
|
||||
{
|
||||
if (!isBreaked()) {
|
||||
Render *re = RE_GetRender(this->m_scene->id.name);
|
||||
Render *re = RE_GetRender(this->m_sceneName);
|
||||
RenderResult *rr = RE_AcquireResultWrite(re);
|
||||
|
||||
if (rr) {
|
||||
@@ -164,7 +165,7 @@ void CompositorOperation::determineResolution(unsigned int resolution[], unsigne
|
||||
|
||||
// check actual render resolution with cropping it may differ with cropped border.rendering
|
||||
// FIX for: [31777] Border Crop gives black (easy)
|
||||
Render *re = RE_GetRender(this->m_scene->id.name);
|
||||
Render *re = RE_GetRender(this->m_sceneName);
|
||||
if (re) {
|
||||
RenderResult *rr = RE_AcquireResultRead(re);
|
||||
if (rr) {
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
#ifndef _COM_CompositorOperation_h
|
||||
#define _COM_CompositorOperation_h
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BLI_rect.h"
|
||||
#include "BLI_string.h"
|
||||
|
||||
/**
|
||||
* @brief Compositor output operation
|
||||
*/
|
||||
class CompositorOperation : public NodeOperation {
|
||||
private:
|
||||
const Scene *m_scene;
|
||||
char m_sceneName[MAX_ID_NAME];
|
||||
|
||||
/**
|
||||
* @brief local reference to the scene
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
public:
|
||||
CompositorOperation();
|
||||
void executeRegion(rcti *rect, unsigned int tileNumber);
|
||||
void setScene(const Scene *scene) { this->m_scene = scene; }
|
||||
void setSceneName(const char *sceneName) { BLI_strncpy(this->m_sceneName, sceneName, sizeof(this->m_sceneName)); }
|
||||
void setRenderData(const RenderData *rd) { this->m_rd = rd; }
|
||||
bool isOutputOperation(bool rendering) const { return true; }
|
||||
void initExecution();
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_ImageOperation.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_image_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BLI_math.h"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define _COM_ImageOperation_h
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BKE_image.h"
|
||||
extern "C" {
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_math_color.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
extern "C" {
|
||||
#include "BKE_movieclip.h"
|
||||
#include "BKE_tracking.h"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
extern "C" {
|
||||
#include "BKE_mask.h"
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_mask_types.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_MovieClipOperation.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BLI_math.h"
|
||||
extern "C" {
|
||||
#include "BKE_movieclip.h"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define _COM_ImageOperation_h
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_path_util.h"
|
||||
#include "BLI_string.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_main.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_PreviewOperation.h"
|
||||
#include "COM_SocketConnection.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_SplitViewerOperation.h"
|
||||
#include "COM_SocketConnection.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_math_color.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_TextureOperation.h"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
TextureBaseOperation::TextureBaseOperation() : NodeOperation()
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define _COM_TextureOperation_h
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_texture_types.h"
|
||||
#include "BLI_listbase.h"
|
||||
extern "C" {
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_math_color.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
extern "C" {
|
||||
#include "BKE_movieclip.h"
|
||||
#include "BKE_tracking.h"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "COM_NodeOperation.h"
|
||||
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_movieclip_types.h"
|
||||
#include "DNA_tracking_types.h"
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_ViewerBaseOperation.h"
|
||||
#include "COM_SocketConnection.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "COM_ViewerOperation.h"
|
||||
#include "COM_SocketConnection.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "BKE_image.h"
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
|
||||
@@ -3787,13 +3787,13 @@ static int bmelemsort_comp(const void *v1, const void *v2)
|
||||
}
|
||||
|
||||
/* Reorders vertices/edges/faces using a given methods. Loops are not supported. */
|
||||
static void sort_bmelem_flag(bContext *C, const int types, const int flag, const int action,
|
||||
static void sort_bmelem_flag(Scene *scene, Object *ob,
|
||||
View3D *v3d, RegionView3D *rv3d,
|
||||
const int types, const int flag, const int action,
|
||||
const int reverse, const unsigned int seed)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
ViewContext vc;
|
||||
BMEditMesh *em;
|
||||
BMEditMesh *em = BMEdit_FromObject(ob);
|
||||
|
||||
BMVert *ve;
|
||||
BMEdge *ed;
|
||||
BMFace *fa;
|
||||
@@ -3811,9 +3811,6 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
if (!(types && flag && action))
|
||||
return;
|
||||
|
||||
em_setup_viewcontext(C, &vc);
|
||||
em = vc.em;
|
||||
|
||||
if (types & BM_VERT)
|
||||
totelem[0] = em->bm->totvert;
|
||||
if (types & BM_EDGE)
|
||||
@@ -3822,7 +3819,6 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
totelem[2] = em->bm->totface;
|
||||
|
||||
if (ELEM(action, SRT_VIEW_ZAXIS, SRT_VIEW_XAXIS)) {
|
||||
RegionView3D *rv3d = ED_view3d_context_rv3d(C);
|
||||
float mat[4][4];
|
||||
float fact = reverse ? -1.0 : 1.0;
|
||||
int coidx = (action == SRT_VIEW_ZAXIS) ? 2 : 0;
|
||||
@@ -3890,7 +3886,6 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
}
|
||||
|
||||
else if (action == SRT_CURSOR_DISTANCE) {
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
float cur[3];
|
||||
float mat[4][4];
|
||||
float fact = reverse ? -1.0 : 1.0;
|
||||
@@ -4220,18 +4215,32 @@ static void sort_bmelem_flag(bContext *C, const int types, const int flag, const
|
||||
|
||||
static int edbm_sort_elements_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
|
||||
/* may be NULL */
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D *rv3d = ED_view3d_context_rv3d(C);
|
||||
|
||||
int action = RNA_enum_get(op->ptr, "type");
|
||||
PropertyRNA *prop_elem_types = RNA_struct_find_property(op->ptr, "elements");
|
||||
int elem_types = 0;
|
||||
int reverse = RNA_boolean_get(op->ptr, "reverse");
|
||||
unsigned int seed = RNA_int_get(op->ptr, "seed");
|
||||
int elem_types = 0;
|
||||
|
||||
if (ELEM(action, SRT_VIEW_ZAXIS, SRT_VIEW_XAXIS)) {
|
||||
if (rv3d == NULL) {
|
||||
BKE_report(op->reports, RPT_ERROR, "View not found, can't sort by view axis");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
}
|
||||
|
||||
/* If no elem_types set, use current selection mode to set it! */
|
||||
if (RNA_property_is_set(op->ptr, prop_elem_types)) {
|
||||
elem_types = RNA_property_enum_get(op->ptr, prop_elem_types);
|
||||
}
|
||||
else {
|
||||
BMEditMesh *em = BMEdit_FromObject(CTX_data_edit_object(C));
|
||||
BMEditMesh *em = BMEdit_FromObject(ob);
|
||||
if (em->selectmode & SCE_SELECT_VERTEX)
|
||||
elem_types |= BM_VERT;
|
||||
if (em->selectmode & SCE_SELECT_EDGE)
|
||||
@@ -4241,7 +4250,8 @@ static int edbm_sort_elements_exec(bContext *C, wmOperator *op)
|
||||
RNA_enum_set(op->ptr, "elements", elem_types);
|
||||
}
|
||||
|
||||
sort_bmelem_flag(C, elem_types, BM_ELEM_SELECT, action, reverse, seed);
|
||||
sort_bmelem_flag(scene, ob, v3d, rv3d,
|
||||
elem_types, BM_ELEM_SELECT, action, reverse, seed);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
|
||||
@@ -1518,8 +1518,8 @@ static void skin_root_clear(BMesh *bm, BMVert *bm_vert, GHash *visited)
|
||||
static int skin_root_mark_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
Mesh *me = ob->data;
|
||||
BMesh *bm = me->edit_btmesh->bm;
|
||||
BMEditMesh *em = BMEdit_FromObject(ob);
|
||||
BMesh *bm = em->bm;
|
||||
BMVert *bm_vert;
|
||||
BMIter bm_iter;
|
||||
GHash *visited;
|
||||
@@ -1574,12 +1574,16 @@ typedef enum {
|
||||
static int skin_loose_mark_clear_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
Mesh *me = ob->data;
|
||||
BMesh *bm = me->edit_btmesh->bm;
|
||||
BMEditMesh *em = BMEdit_FromObject(ob);
|
||||
BMesh *bm = em->bm;
|
||||
BMVert *bm_vert;
|
||||
BMIter bm_iter;
|
||||
SkinLooseAction action = RNA_enum_get(op->ptr, "action");
|
||||
|
||||
if (!CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
BM_ITER_MESH (bm_vert, &bm_iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (bm_vert->head.hflag & BM_ELEM_SELECT) {
|
||||
MVertSkin *vs = CustomData_bmesh_get(&bm->vdata,
|
||||
@@ -1628,11 +1632,15 @@ void OBJECT_OT_skin_loose_mark_clear(wmOperatorType *ot)
|
||||
static int skin_radii_equalize_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Object *ob = CTX_data_edit_object(C);
|
||||
Mesh *me = ob->data;
|
||||
BMesh *bm = me->edit_btmesh->bm;
|
||||
BMEditMesh *em = BMEdit_FromObject(ob);
|
||||
BMesh *bm = em->bm;
|
||||
BMVert *bm_vert;
|
||||
BMIter bm_iter;
|
||||
|
||||
if (!CustomData_has_layer(&bm->vdata, CD_MVERT_SKIN)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
BM_ITER_MESH (bm_vert, &bm_iter, bm, BM_VERTS_OF_MESH) {
|
||||
if (bm_vert->head.hflag & BM_ELEM_SELECT) {
|
||||
MVertSkin *vs = CustomData_bmesh_get(&bm->vdata,
|
||||
@@ -1804,9 +1812,15 @@ static int skin_armature_create_exec(bContext *C, wmOperator *op)
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *ob = CTX_data_active_object(C), *arm_ob;
|
||||
Mesh *me = ob->data;
|
||||
ModifierData *skin_md;
|
||||
ArmatureModifierData *arm_md;
|
||||
|
||||
if (!CustomData_has_layer(&me->vdata, CD_MVERT_SKIN)) {
|
||||
BKE_reportf(op->reports, RPT_WARNING, "Mesh '%s' has no skin vertex data", me->id.name + 2);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* create new armature */
|
||||
arm_ob = modifier_skin_armature_create(scene, ob);
|
||||
|
||||
|
||||
@@ -204,21 +204,27 @@ int space_image_main_area_not_uv_brush_poll(bContext *C)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int space_image_image_sample_poll(bContext *C)
|
||||
static int image_sample_poll(bContext *C)
|
||||
{
|
||||
SpaceImage *sima = CTX_wm_space_image(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings;
|
||||
if (sima) {
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *toolsettings = scene->toolsettings;
|
||||
|
||||
if (obedit) {
|
||||
if (ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt))
|
||||
return 0;
|
||||
}
|
||||
else if (sima->mode != SI_MODE_VIEW) {
|
||||
return 0;
|
||||
}
|
||||
if (obedit) {
|
||||
if (ED_space_image_show_uvedit(sima, obedit) && (toolsettings->use_uv_sculpt))
|
||||
return FALSE;
|
||||
}
|
||||
else if (sima->mode != SI_MODE_VIEW) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return space_image_main_area_poll(C);
|
||||
return space_image_main_area_poll(C);
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/********************** view pan operator *********************/
|
||||
|
||||
@@ -2165,7 +2171,7 @@ void IMAGE_OT_sample(wmOperatorType *ot)
|
||||
ot->invoke = image_sample_invoke;
|
||||
ot->modal = image_sample_modal;
|
||||
ot->cancel = image_sample_cancel;
|
||||
ot->poll = space_image_image_sample_poll;
|
||||
ot->poll = image_sample_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_BLOCKING;
|
||||
|
||||
Reference in New Issue
Block a user