forked from bartvdbraak/blender
- added xmirror to the weightpaint options
- made texture_slot return the texture slot for the node texture
This commit is contained in:
parent
51f11abe45
commit
dd96bf6168
@ -219,8 +219,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
|
|||||||
|
|
||||||
class TEXTURE_PT_influence(TextureSlotPanel):
|
class TEXTURE_PT_influence(TextureSlotPanel):
|
||||||
__label__ = "Influence"
|
__label__ = "Influence"
|
||||||
|
def poll(self, context):
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
|
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
idblock = context_tex_datablock(context)
|
idblock = context_tex_datablock(context)
|
||||||
|
@ -651,6 +651,11 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
|
|||||||
col.itemR(wpaint, "spray")
|
col.itemR(wpaint, "spray")
|
||||||
col.itemR(wpaint, "vertex_dist", text="Distance")
|
col.itemR(wpaint, "vertex_dist", text="Distance")
|
||||||
|
|
||||||
|
|
||||||
|
data = context.weight_paint_object.data
|
||||||
|
if type(data) == bpy.types.Mesh:
|
||||||
|
col.itemR(data, "use_mirror_x")
|
||||||
|
|
||||||
# Commented out because the Apply button isn't an operator yet, making these settings useless
|
# Commented out because the Apply button isn't an operator yet, making these settings useless
|
||||||
# col.itemL(text="Gamma:")
|
# col.itemL(text="Gamma:")
|
||||||
# col.itemR(wpaint, "gamma", text="")
|
# col.itemR(wpaint, "gamma", text="")
|
||||||
|
@ -47,6 +47,7 @@ void test_object_materials(struct ID *id);
|
|||||||
void init_material(struct Material *ma);
|
void init_material(struct Material *ma);
|
||||||
struct Material *add_material(char *name);
|
struct Material *add_material(char *name);
|
||||||
struct Material *copy_material(struct Material *ma);
|
struct Material *copy_material(struct Material *ma);
|
||||||
|
struct Material *give_node_material(struct Material *ma); /* returns node material or self */
|
||||||
void make_local_material(struct Material *ma);
|
void make_local_material(struct Material *ma);
|
||||||
|
|
||||||
void automatname(struct Material *);
|
void automatname(struct Material *);
|
||||||
|
@ -485,6 +485,18 @@ ID *material_from(Object *ob, int act)
|
|||||||
else return ob->data;
|
else return ob->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Material *give_node_material(Material *ma)
|
||||||
|
{
|
||||||
|
if(ma && ma->use_nodes && ma->nodetree) {
|
||||||
|
bNode *node= nodeGetActiveID(ma->nodetree, ID_MA);
|
||||||
|
|
||||||
|
if(node)
|
||||||
|
return (Material *)node->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* GS reads the memory pointed at in a specific ordering. There are,
|
/* GS reads the memory pointed at in a specific ordering. There are,
|
||||||
* however two definitions for it. I have jotted them down here, both,
|
* however two definitions for it. I have jotted them down here, both,
|
||||||
* but I think the first one is actually used. The thing is that
|
* but I think the first one is actually used. The thing is that
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
|
#include "GPU_extensions.h"
|
||||||
|
|
||||||
#include "BLI_arithb.h"
|
#include "BLI_arithb.h"
|
||||||
#include "BLI_blenlib.h"
|
#include "BLI_blenlib.h"
|
||||||
#include "BLI_storage_types.h"
|
#include "BLI_storage_types.h"
|
||||||
|
@ -622,7 +622,9 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
|
|||||||
PointerRNA *ptr;
|
PointerRNA *ptr;
|
||||||
|
|
||||||
if((ptr=get_pointer_type(path, &RNA_Material))) {
|
if((ptr=get_pointer_type(path, &RNA_Material))) {
|
||||||
Material *ma= ptr->data;
|
Material *ma= ptr->data; /* should this be made a different option? */
|
||||||
|
Material *ma_node= give_node_material(ma);
|
||||||
|
ma= ma_node?ma_node:ma;
|
||||||
|
|
||||||
if(ma)
|
if(ma)
|
||||||
CTX_data_pointer_set(result, &ma->id, &RNA_MaterialTextureSlot, ma->mtex[(int)ma->texact]);
|
CTX_data_pointer_set(result, &ma->id, &RNA_MaterialTextureSlot, ma->mtex[(int)ma->texact]);
|
||||||
|
@ -58,6 +58,7 @@ static EnumPropertyItem prop_texture_coordinates_items[] = {
|
|||||||
|
|
||||||
#include "BKE_depsgraph.h"
|
#include "BKE_depsgraph.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
|
#include "BKE_material.h"
|
||||||
#include "BKE_texture.h"
|
#include "BKE_texture.h"
|
||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
|
|
||||||
@ -143,19 +144,8 @@ static void rna_Material_active_texture_set(PointerRNA *ptr, PointerRNA value)
|
|||||||
|
|
||||||
static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
|
static PointerRNA rna_Material_active_node_material_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Material *ma= (Material*)ptr->data;
|
Material *ma= give_node_material((Material*)ptr->data);
|
||||||
Material *ma_node= NULL;
|
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma);
|
||||||
|
|
||||||
/* used in buttons to check context, also checks for edited groups */
|
|
||||||
|
|
||||||
if(ma && ma->use_nodes && ma->nodetree) {
|
|
||||||
bNode *node= nodeGetActiveID(ma->nodetree, ID_MA);
|
|
||||||
|
|
||||||
if(node)
|
|
||||||
ma_node= (Material *)node->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_Material, ma_node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value)
|
static void rna_Material_active_node_material_set(PointerRNA *ptr, PointerRNA value)
|
||||||
|
Loading…
Reference in New Issue
Block a user