Merge branch 'master' into 28
This commit is contained in:
@@ -969,11 +969,11 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = md.target is not None
|
||||
|
||||
if md.is_bound:
|
||||
col.operator("object.surfacedeform_bind", text="Unbind")
|
||||
else:
|
||||
col.active = md.target is not None
|
||||
col.operator("object.surfacedeform_bind", text="Bind")
|
||||
|
||||
def UV_PROJECT(self, layout, ob, md):
|
||||
|
||||
@@ -56,6 +56,7 @@ AbcHairWriter::AbcHairWriter(Scene *scene,
|
||||
ExportSettings &settings,
|
||||
ParticleSystem *psys)
|
||||
: AbcObjectWriter(scene, ob, time_sampling, settings, parent)
|
||||
, m_uv_warning_shown(false)
|
||||
{
|
||||
m_psys = psys;
|
||||
|
||||
@@ -132,8 +133,10 @@ void AbcHairWriter::write_hair_sample(DerivedMesh *dm,
|
||||
MFace *mface = dm->getTessFaceArray(dm);
|
||||
MVert *mverts = dm->getVertArray(dm);
|
||||
|
||||
if (!mtface || !mface) {
|
||||
std::fprintf(stderr, "Warning, no UV set found for underlying geometry.\n");
|
||||
if ((!mtface || !mface) && !m_uv_warning_shown) {
|
||||
std::fprintf(stderr, "Warning, no UV set found for underlying geometry of %s.\n",
|
||||
m_object->id.name + 2);
|
||||
m_uv_warning_shown = true;
|
||||
}
|
||||
|
||||
ParticleData * pa = m_psys->particles;
|
||||
@@ -241,10 +244,6 @@ void AbcHairWriter::write_hair_child_sample(DerivedMesh *dm,
|
||||
MFace *mface = dm->getTessFaceArray(dm);
|
||||
MVert *mverts = dm->getVertArray(dm);
|
||||
|
||||
if (!mtface || !mface) {
|
||||
std::fprintf(stderr, "Warning, no UV set found for underlying geometry.\n");
|
||||
}
|
||||
|
||||
ParticleCacheKey **cache = m_psys->childcache;
|
||||
ParticleCacheKey *path;
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ class AbcHairWriter : public AbcObjectWriter {
|
||||
Alembic::AbcGeom::OCurvesSchema m_schema;
|
||||
Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
|
||||
|
||||
bool m_uv_warning_shown;
|
||||
|
||||
public:
|
||||
AbcHairWriter(Scene *scene,
|
||||
Object *ob,
|
||||
|
||||
@@ -60,8 +60,9 @@ typedef struct EditFont {
|
||||
struct CharInfo *textbufinfo;
|
||||
|
||||
/* array of rectangles & rotation */
|
||||
EditFontSelBox *selboxes;
|
||||
float textcurs[4][2];
|
||||
EditFontSelBox *selboxes;
|
||||
int selboxes_len;
|
||||
|
||||
/* positional vars relative to the textbuf, textbufinfo (not utf8 bytes)
|
||||
* a copy of these is kept in Curve, but use these in editmode */
|
||||
|
||||
@@ -695,10 +695,14 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, int mode, ListBase *r_nubase
|
||||
if (ef->selboxes)
|
||||
MEM_freeN(ef->selboxes);
|
||||
|
||||
if (BKE_vfont_select_get(ob, &selstart, &selend))
|
||||
ef->selboxes = MEM_callocN((selend - selstart + 1) * sizeof(EditFontSelBox), "font selboxes");
|
||||
else
|
||||
if (BKE_vfont_select_get(ob, &selstart, &selend)) {
|
||||
ef->selboxes_len = (selend - selstart) + 1;
|
||||
ef->selboxes = MEM_callocN(ef->selboxes_len * sizeof(EditFontSelBox), "font selboxes");
|
||||
}
|
||||
else {
|
||||
ef->selboxes_len = 0;
|
||||
ef->selboxes = NULL;
|
||||
}
|
||||
|
||||
selboxes = ef->selboxes;
|
||||
}
|
||||
|
||||
@@ -3618,9 +3618,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
|
||||
psys_get_pointcache_start_end(scene, pid->calldata, &cache->startframe, &cache->endframe);
|
||||
}
|
||||
|
||||
if ((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID)==0) &&
|
||||
(render || bake))
|
||||
{
|
||||
if (((cache->flag & PTCACHE_BAKED) == 0) && (render || bake)) {
|
||||
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ void DifferenceMatteOperation::executePixelSampled(float output[4], float x, flo
|
||||
difference = difference / 3.0f;
|
||||
|
||||
/* make 100% transparent */
|
||||
if (difference < tolerance) {
|
||||
if (difference <= tolerance) {
|
||||
output[0] = 0.0f;
|
||||
}
|
||||
/*in the falloff region, make partially transparent */
|
||||
else if (difference < falloff + tolerance) {
|
||||
else if (difference <= falloff + tolerance) {
|
||||
difference = difference - tolerance;
|
||||
alpha = difference / falloff;
|
||||
/*only change if more transparent than before */
|
||||
|
||||
@@ -63,7 +63,7 @@ int ED_space_clip_get_clip_frame_number(struct SpaceClip *sc);
|
||||
struct ImBuf *ED_space_clip_get_buffer(struct SpaceClip *sc);
|
||||
struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2], float *scale, float *angle);
|
||||
|
||||
bool ED_space_clip_color_sample(struct Scene *scene, struct SpaceClip *sc, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
bool ED_space_clip_color_sample(struct SpaceClip *sc, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
|
||||
void ED_clip_update_frame(const struct Main *mainp, int cfra);
|
||||
bool ED_clip_view_selection(const struct bContext *C, struct ARegion *ar, bool fit);
|
||||
|
||||
@@ -47,7 +47,7 @@ void ED_space_image_set(struct SpaceImage *sima, struct Scene *scene, s
|
||||
struct Mask *ED_space_image_get_mask(struct SpaceImage *sima);
|
||||
void ED_space_image_set_mask(struct bContext *C, struct SpaceImage *sima, struct Mask *mask);
|
||||
|
||||
bool ED_space_image_color_sample(struct Scene *scene, struct SpaceImage *sima, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
bool ED_space_image_color_sample(struct SpaceImage *sima, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
struct ImBuf *ED_space_image_acquire_buffer(struct SpaceImage *sima, void **r_lock);
|
||||
void ED_space_image_release_buffer(struct SpaceImage *sima, struct ImBuf *ibuf, void *lock);
|
||||
bool ED_space_image_has_buffer(struct SpaceImage *sima);
|
||||
|
||||
@@ -107,7 +107,7 @@ void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree,
|
||||
void ED_operatormacros_node(void);
|
||||
|
||||
/* node_view.c */
|
||||
bool ED_space_node_color_sample(struct Scene *scene, struct SpaceNode *snode, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
bool ED_space_node_color_sample(struct SpaceNode *snode, struct ARegion *ar, int mval[2], float r_col[3]);
|
||||
|
||||
#endif /* __ED_NODE_H__ */
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ static bool eyedropper_init(bContext *C, wmOperator *op)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (RNA_property_subtype(eye->prop) == PROP_COLOR) {
|
||||
if (RNA_property_subtype(eye->prop) != PROP_COLOR) {
|
||||
const char *display_device;
|
||||
float col[4];
|
||||
|
||||
@@ -235,7 +235,7 @@ static bool eyedropper_init(bContext *C, wmOperator *op)
|
||||
/* store inital color */
|
||||
RNA_property_float_get_array(&eye->ptr, eye->prop, col);
|
||||
if (eye->display) {
|
||||
IMB_colormanagement_scene_linear_to_display_v3(col, eye->display);
|
||||
IMB_colormanagement_display_to_scene_linear_v3(col, eye->display);
|
||||
}
|
||||
copy_v3_v3(eye->init_col, col);
|
||||
}
|
||||
@@ -266,6 +266,8 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
|
||||
/* we could use some clever */
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
ScrArea *sa = BKE_screen_find_area_xy(win->screen, SPACE_TYPE_ANY, mx, my);
|
||||
const char *display_device = CTX_data_scene(C)->display_settings.display_device;
|
||||
struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device);
|
||||
|
||||
if (sa) {
|
||||
if (sa->spacetype == SPACE_IMAGE) {
|
||||
@@ -275,7 +277,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
|
||||
int mval[2] = {mx - ar->winrct.xmin,
|
||||
my - ar->winrct.ymin};
|
||||
|
||||
if (ED_space_image_color_sample(CTX_data_scene(C), sima, ar, mval, r_col)) {
|
||||
if (ED_space_image_color_sample(sima, ar, mval, r_col)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -287,7 +289,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
|
||||
int mval[2] = {mx - ar->winrct.xmin,
|
||||
my - ar->winrct.ymin};
|
||||
|
||||
if (ED_space_node_color_sample(CTX_data_scene(C), snode, ar, mval, r_col)) {
|
||||
if (ED_space_node_color_sample(snode, ar, mval, r_col)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +301,7 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
|
||||
int mval[2] = {mx - ar->winrct.xmin,
|
||||
my - ar->winrct.ymin};
|
||||
|
||||
if (ED_space_clip_color_sample(CTX_data_scene(C), sc, ar, mval, r_col)) {
|
||||
if (ED_space_clip_color_sample(sc, ar, mval, r_col)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -310,6 +312,8 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
|
||||
glReadBuffer(GL_FRONT);
|
||||
glReadPixels(mx, my, 1, 1, GL_RGB, GL_FLOAT, r_col);
|
||||
glReadBuffer(GL_BACK);
|
||||
|
||||
IMB_colormanagement_display_to_scene_linear_v3(r_col, display);
|
||||
}
|
||||
|
||||
/* sets the sample color RGB, maintaining A */
|
||||
@@ -320,10 +324,10 @@ static void eyedropper_color_set(bContext *C, Eyedropper *eye, const float col[3
|
||||
/* to maintain alpha */
|
||||
RNA_property_float_get_array(&eye->ptr, eye->prop, col_conv);
|
||||
|
||||
/* convert from display space to linear rgb space */
|
||||
/* convert from linear rgb space to display space */
|
||||
if (eye->display) {
|
||||
copy_v3_v3(col_conv, col);
|
||||
IMB_colormanagement_display_to_scene_linear_v3(col_conv, eye->display);
|
||||
IMB_colormanagement_scene_linear_to_display_v3(col_conv, eye->display);
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(col_conv, col);
|
||||
|
||||
@@ -259,11 +259,9 @@ ImBuf *ED_space_clip_get_stable_buffer(SpaceClip *sc, float loc[2], float *scale
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Returns color in the display space, matching ED_space_image_color_sample(). */
|
||||
bool ED_space_clip_color_sample(Scene *scene, SpaceClip *sc, ARegion *ar, int mval[2], float r_col[3])
|
||||
/* Returns color in linear space, matching ED_space_image_color_sample(). */
|
||||
bool ED_space_clip_color_sample(SpaceClip *sc, ARegion *ar, int mval[2], float r_col[3])
|
||||
{
|
||||
const char *display_device = scene->display_settings.display_device;
|
||||
struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device);
|
||||
ImBuf *ibuf;
|
||||
float fx, fy, co[2];
|
||||
bool ret = false;
|
||||
@@ -299,11 +297,7 @@ bool ED_space_clip_color_sample(Scene *scene, SpaceClip *sc, ARegion *ar, int mv
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
IMB_colormanagement_scene_linear_to_display_v3(r_col, display);
|
||||
}
|
||||
|
||||
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -2902,11 +2902,9 @@ static void image_sample_draw(const bContext *C, ARegion *ar, void *arg_info)
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns color in the display space, matching ED_space_node_color_sample(). */
|
||||
bool ED_space_image_color_sample(Scene *scene, SpaceImage *sima, ARegion *ar, int mval[2], float r_col[3])
|
||||
/* Returns color in linear space, matching ED_space_node_color_sample(). */
|
||||
bool ED_space_image_color_sample(SpaceImage *sima, ARegion *ar, int mval[2], float r_col[3])
|
||||
{
|
||||
const char *display_device = scene->display_settings.display_device;
|
||||
struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device);
|
||||
void *lock;
|
||||
ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
|
||||
float fx, fy;
|
||||
@@ -2940,10 +2938,6 @@ bool ED_space_image_color_sample(Scene *scene, SpaceImage *sima, ARegion *ar, in
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
IMB_colormanagement_scene_linear_to_display_v3(r_col, display);
|
||||
}
|
||||
|
||||
ED_space_image_release_buffer(sima, ibuf, lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ static int node_group_operator_editable(bContext *C)
|
||||
* Disabled otherwise to allow pynodes define their own operators
|
||||
* with same keymap.
|
||||
*/
|
||||
if (STREQ(snode->tree_idname, "ShaderNodeTree") ||
|
||||
STREQ(snode->tree_idname, "CompositorNodeTree") ||
|
||||
STREQ(snode->tree_idname, "TextureNodeTree"))
|
||||
if (ED_node_is_shader(snode) ||
|
||||
ED_node_is_compositor(snode) ||
|
||||
ED_node_is_texture(snode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -112,11 +112,11 @@ static const char *group_node_idname(bContext *C)
|
||||
{
|
||||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
|
||||
if (STREQ(snode->tree_idname, "ShaderNodeTree"))
|
||||
if (ED_node_is_shader(snode))
|
||||
return "ShaderNodeGroup";
|
||||
else if (STREQ(snode->tree_idname, "CompositorNodeTree"))
|
||||
else if (ED_node_is_compositor(snode))
|
||||
return "CompositorNodeGroup";
|
||||
else if (STREQ(snode->tree_idname, "TextureNodeTree"))
|
||||
else if (ED_node_is_texture(snode))
|
||||
return "TextureNodeGroup";
|
||||
|
||||
return "";
|
||||
|
||||
@@ -417,20 +417,18 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns color in the display space, matching ED_space_image_color_sample().
|
||||
/* Returns color in linear space, matching ED_space_image_color_sample().
|
||||
* And here we've got recursion in the comments tips...
|
||||
*/
|
||||
bool ED_space_node_color_sample(Scene *scene, SpaceNode *snode, ARegion *ar, int mval[2], float r_col[3])
|
||||
bool ED_space_node_color_sample(SpaceNode *snode, ARegion *ar, int mval[2], float r_col[3])
|
||||
{
|
||||
const char *display_device = scene->display_settings.display_device;
|
||||
struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(display_device);
|
||||
void *lock;
|
||||
Image *ima;
|
||||
ImBuf *ibuf;
|
||||
float fx, fy, bufx, bufy;
|
||||
bool ret = false;
|
||||
|
||||
if (STREQ(snode->tree_idname, ntreeType_Composite->idname) || (snode->flag & SNODE_BACKDRAW) == 0) {
|
||||
if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
|
||||
/* use viewer image for color sampling only if we're in compositor tree
|
||||
* with backdrop enabled
|
||||
*/
|
||||
@@ -471,10 +469,6 @@ bool ED_space_node_color_sample(Scene *scene, SpaceNode *snode, ARegion *ar, int
|
||||
}
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
IMB_colormanagement_scene_linear_to_display_v3(r_col, display);
|
||||
}
|
||||
|
||||
BKE_image_release_ibuf(ima, ibuf, lock);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -7436,7 +7436,6 @@ static void draw_editfont(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3
|
||||
Curve *cu = ob->data;
|
||||
EditFont *ef = cu->editfont;
|
||||
float vec1[3], vec2[3];
|
||||
int selstart, selend;
|
||||
|
||||
draw_editfont_textcurs(rv3d, ef->textcurs);
|
||||
|
||||
@@ -7495,19 +7494,18 @@ static void draw_editfont(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3
|
||||
setlinestyle(0);
|
||||
|
||||
|
||||
if (BKE_vfont_select_get(ob, &selstart, &selend) && ef->selboxes) {
|
||||
const int seltot = selend - selstart;
|
||||
if (ef->selboxes && ef->selboxes_len) {
|
||||
float selboxw;
|
||||
|
||||
unsigned int pos = VertexFormat_add_attrib(immVertexFormat(), "pos", COMP_F32, 3, KEEP_FLOAT);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
imm_cpack(0xffffff);
|
||||
set_inverted_drawing(1);
|
||||
for (int i = 0; i <= seltot; i++) {
|
||||
for (int i = 0; i < ef->selboxes_len; i++) {
|
||||
EditFontSelBox *sb = &ef->selboxes[i];
|
||||
float tvec[3];
|
||||
|
||||
if (i != seltot) {
|
||||
if (i + 1 != ef->selboxes_len) {
|
||||
if (ef->selboxes[i + 1].y == sb->y)
|
||||
selboxw = ef->selboxes[i + 1].x - sb->x;
|
||||
else
|
||||
|
||||
@@ -1178,7 +1178,7 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
|
||||
{
|
||||
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
|
||||
|
||||
return !smd->target;
|
||||
return !smd->target && !(smd->verts && !(smd->flags & MOD_SDEF_BIND));
|
||||
}
|
||||
|
||||
ModifierTypeInfo modifierType_SurfaceDeform = {
|
||||
|
||||
Reference in New Issue
Block a user