adds object as source
This commit is contained in:
parent
b14c7a19db
commit
9765e28786
4 changed files with 22 additions and 3 deletions
|
|
@ -1 +1 @@
|
||||||
1.0.0+build.18
|
1.1.0+build.1
|
||||||
|
|
@ -50,4 +50,5 @@ class BakeToIDMapOperator(bpy.types.Operator):
|
||||||
|
|
||||||
target = get_target(props.target)
|
target = get_target(props.target)
|
||||||
target.paint_targets(props, targets, colors)
|
target.paint_targets(props, targets, colors)
|
||||||
source.after_painting(context, props)
|
if 'after_painting' in dir(source):
|
||||||
|
source.after_painting(context, props)
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
from . sources import material_index as source_mat_index
|
from . sources import material_index as source_mat_index
|
||||||
|
from . sources import object as source_object
|
||||||
|
|
||||||
from . targets import vertex_colors as target_vertex_colors
|
from . targets import vertex_colors as target_vertex_colors
|
||||||
|
|
||||||
_sources = [
|
_sources = [
|
||||||
source_mat_index
|
source_mat_index,
|
||||||
|
source_object
|
||||||
]
|
]
|
||||||
|
|
||||||
_targets = [
|
_targets = [
|
||||||
|
|
|
||||||
16
src/types/sources/object.py
Normal file
16
src/types/sources/object.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
source_id = 'OBJECT'
|
||||||
|
name = 'Object ID'
|
||||||
|
description = 'Uses the object id as basis for the ID mask.'
|
||||||
|
|
||||||
|
connected_properties = []
|
||||||
|
|
||||||
|
def get_targets(context):
|
||||||
|
targets = []
|
||||||
|
for obj in context.selected_objects:
|
||||||
|
mesh = obj.data
|
||||||
|
targets.append((mesh, mesh.polygons))
|
||||||
|
|
||||||
|
return targets
|
||||||
|
|
||||||
|
def estimate_ids(context, props):
|
||||||
|
return len(context.selected_objects)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue