forked from bartvdbraak/blender
Merging r37371 through r37433 from trunk into soc-2011-tomato
This commit is contained in:
commit
558d1e8d4a
@ -53,8 +53,17 @@ if(NOT DEFINED PYTHON_INCLUDE_DIRS)
|
|||||||
if(NOT _Found_PYTHON_H)
|
if(NOT _Found_PYTHON_H)
|
||||||
message(FATAL_ERROR "Python.h not found")
|
message(FATAL_ERROR "Python.h not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_Found_PYTHON_H)
|
||||||
|
unset(_Python_HEADER)
|
||||||
|
unset(_CURRENT_ABI_FLAGS)
|
||||||
|
unset(_CURRENT_PATH)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_Python_ABI_FLAGS)
|
||||||
|
unset(_Python_PATHS)
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# now the python versions are found
|
# now the python versions are found
|
||||||
|
|
||||||
|
@ -5,22 +5,28 @@
|
|||||||
# use it instead of include_directories()
|
# use it instead of include_directories()
|
||||||
macro(blender_include_dirs
|
macro(blender_include_dirs
|
||||||
includes)
|
includes)
|
||||||
|
set(_ALL_INCS "")
|
||||||
foreach(inc ${ARGV})
|
foreach(_INC ${ARGV})
|
||||||
get_filename_component(abs_inc ${inc} ABSOLUTE)
|
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||||
list(APPEND all_incs ${abs_inc})
|
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||||
endforeach()
|
endforeach()
|
||||||
include_directories(${all_incs})
|
include_directories(${_ALL_INCS})
|
||||||
|
unset(_INC)
|
||||||
|
unset(_ABS_INC)
|
||||||
|
unset(_ALL_INCS)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(blender_include_dirs_sys
|
macro(blender_include_dirs_sys
|
||||||
includes)
|
includes)
|
||||||
|
set(_ALL_INCS "")
|
||||||
foreach(inc ${ARGV})
|
foreach(_INC ${ARGV})
|
||||||
get_filename_component(abs_inc ${inc} ABSOLUTE)
|
get_filename_component(_ABS_INC ${_INC} ABSOLUTE)
|
||||||
list(APPEND all_incs ${abs_inc})
|
list(APPEND _ALL_INCS ${_ABS_INC})
|
||||||
endforeach()
|
endforeach()
|
||||||
include_directories(SYSTEM ${all_incs})
|
include_directories(SYSTEM ${_ALL_INCS})
|
||||||
|
unset(_INC)
|
||||||
|
unset(_ABS_INC)
|
||||||
|
unset(_ALL_INCS)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(blender_source_group
|
macro(blender_source_group
|
||||||
@ -29,14 +35,17 @@ macro(blender_source_group
|
|||||||
# Group by location on disk
|
# Group by location on disk
|
||||||
source_group("Source Files" FILES CMakeLists.txt)
|
source_group("Source Files" FILES CMakeLists.txt)
|
||||||
|
|
||||||
foreach(SRC ${sources})
|
foreach(_SRC ${sources})
|
||||||
get_filename_component(SRC_EXT ${SRC} EXT)
|
get_filename_component(_SRC_EXT ${_SRC} EXT)
|
||||||
if(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp")
|
if(${_SRC_EXT} MATCHES ".h" OR ${_SRC_EXT} MATCHES ".hpp")
|
||||||
source_group("Header Files" FILES ${SRC})
|
source_group("Header Files" FILES ${_SRC})
|
||||||
else()
|
else()
|
||||||
source_group("Source Files" FILES ${SRC})
|
source_group("Source Files" FILES ${_SRC})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
unset(_SRC)
|
||||||
|
unset(_SRC_EXT)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
@ -196,10 +205,11 @@ macro(setup_liblinks
|
|||||||
endif()
|
endif()
|
||||||
if(WITH_IMAGE_OPENEXR)
|
if(WITH_IMAGE_OPENEXR)
|
||||||
if(WIN32 AND NOT UNIX)
|
if(WIN32 AND NOT UNIX)
|
||||||
foreach(loop_var ${OPENEXR_LIB})
|
foreach(_LOOP_VAR ${OPENEXR_LIB})
|
||||||
target_link_libraries(${target} debug ${loop_var}_d)
|
target_link_libraries(${target} debug ${_LOOP_VAR}_d)
|
||||||
target_link_libraries(${target} optimized ${loop_var})
|
target_link_libraries(${target} optimized ${_LOOP_VAR})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
unset(_LOOP_VAR)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${target} ${OPENEXR_LIB})
|
target_link_libraries(${target} ${OPENEXR_LIB})
|
||||||
endif()
|
endif()
|
||||||
@ -212,10 +222,11 @@ macro(setup_liblinks
|
|||||||
endif()
|
endif()
|
||||||
if(WITH_OPENCOLLADA)
|
if(WITH_OPENCOLLADA)
|
||||||
if(WIN32 AND NOT UNIX)
|
if(WIN32 AND NOT UNIX)
|
||||||
foreach(loop_var ${OPENCOLLADA_LIB})
|
foreach(_LOOP_VAR ${OPENCOLLADA_LIB})
|
||||||
target_link_libraries(${target} debug ${loop_var}_d)
|
target_link_libraries(${target} debug ${_LOOP_VAR}_d)
|
||||||
target_link_libraries(${target} optimized ${loop_var})
|
target_link_libraries(${target} optimized ${_LOOP_VAR})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
unset(_LOOP_VAR)
|
||||||
target_link_libraries(${target} debug ${PCRE_LIB}_d)
|
target_link_libraries(${target} debug ${PCRE_LIB}_d)
|
||||||
target_link_libraries(${target} optimized ${PCRE_LIB})
|
target_link_libraries(${target} optimized ${PCRE_LIB})
|
||||||
if(EXPAT_LIB)
|
if(EXPAT_LIB)
|
||||||
@ -472,4 +483,13 @@ macro(blender_project_hack_post)
|
|||||||
|
|
||||||
unset(_reset_standard_cflags_rel)
|
unset(_reset_standard_cflags_rel)
|
||||||
unset(_reset_standard_cxxflags_rel)
|
unset(_reset_standard_cxxflags_rel)
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# workaround for omission in cmake 2.8.4's GNU.cmake
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
if(NOT DARWIN)
|
||||||
|
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@ -120,22 +120,25 @@ def expand(line, cursor, namespace, private=True):
|
|||||||
from . import complete_calltip
|
from . import complete_calltip
|
||||||
matches, word, scrollback = complete_calltip.complete(line,
|
matches, word, scrollback = complete_calltip.complete(line,
|
||||||
cursor, namespace)
|
cursor, namespace)
|
||||||
|
prefix = os.path.commonprefix(matches)[len(word):]
|
||||||
no_calltip = False
|
no_calltip = False
|
||||||
else:
|
else:
|
||||||
matches, word = complete(line, cursor, namespace, private)
|
matches, word = complete(line, cursor, namespace, private)
|
||||||
|
prefix = os.path.commonprefix(matches)[len(word):]
|
||||||
if len(matches) == 1:
|
if len(matches) == 1:
|
||||||
scrollback = ''
|
scrollback = ''
|
||||||
else:
|
else:
|
||||||
# causes blender bug [#27495] since string keys may contain '.'
|
# causes blender bug [#27495] since string keys may contain '.'
|
||||||
# scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
# scrollback = ' '.join([m.split('.')[-1] for m in matches])
|
||||||
|
word_prefix = word + prefix
|
||||||
scrollback = ' '.join(
|
scrollback = ' '.join(
|
||||||
[m[len(word):]
|
[m[len(word_prefix):]
|
||||||
if (word and m.startswith(word))
|
if (word_prefix and m.startswith(word_prefix))
|
||||||
else m.split('.')[-1]
|
else m.split('.')[-1]
|
||||||
for m in matches])
|
for m in matches])
|
||||||
|
|
||||||
no_calltip = True
|
no_calltip = True
|
||||||
prefix = os.path.commonprefix(matches)[len(word):]
|
|
||||||
if prefix:
|
if prefix:
|
||||||
line = line[:cursor] + prefix + line[cursor:]
|
line = line[:cursor] + prefix + line[cursor:]
|
||||||
cursor += len(prefix)
|
cursor += len(prefix)
|
||||||
|
@ -22,10 +22,9 @@ from mathutils import Vector
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty
|
from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty
|
||||||
|
|
||||||
|
class QuickFur(bpy.types.Operator):
|
||||||
class MakeFur(bpy.types.Operator):
|
bl_idname = "object.quick_fur"
|
||||||
bl_idname = "object.make_fur"
|
bl_label = "Quick Fur"
|
||||||
bl_label = "Make Fur"
|
|
||||||
bl_options = {'REGISTER', 'UNDO'}
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
density = EnumProperty(items=(
|
density = EnumProperty(items=(
|
||||||
@ -79,6 +78,155 @@ class MakeFur(bpy.types.Operator):
|
|||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
class QuickExplode(bpy.types.Operator):
|
||||||
|
bl_idname = "object.quick_explode"
|
||||||
|
bl_label = "Quick Explode"
|
||||||
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
|
style = EnumProperty(items=(
|
||||||
|
('EXPLODE', "Explode", ""),
|
||||||
|
('BLEND', "Blend", "")),
|
||||||
|
name="Explode Style",
|
||||||
|
description="",
|
||||||
|
default='EXPLODE')
|
||||||
|
|
||||||
|
amount = IntProperty(name="Amount of pieces",
|
||||||
|
default=100, min=2, max=10000, soft_min=2, soft_max=10000)
|
||||||
|
|
||||||
|
duration = IntProperty(name="Duration",
|
||||||
|
default=50, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||||
|
|
||||||
|
start_frame = IntProperty(name="Start Frame",
|
||||||
|
default=1, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||||
|
|
||||||
|
end_frame = IntProperty(name="End Frame",
|
||||||
|
default=10, min=1, max=10000, soft_min=1, soft_max=10000)
|
||||||
|
|
||||||
|
velocity = FloatProperty(name="Outwards Velocity",
|
||||||
|
default=1, min=0, max=1000, soft_min=0, soft_max=10)
|
||||||
|
|
||||||
|
fade = BoolProperty(name="Fade",
|
||||||
|
description="Fade the pieces over time.",
|
||||||
|
default=True)
|
||||||
|
|
||||||
|
invert_order = BoolProperty(name="Invert Order",
|
||||||
|
description="Blend objects in the opposite direction (only for Blend style explosion).",
|
||||||
|
default=False)
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
fake_context = bpy.context.copy()
|
||||||
|
mesh_objects = [obj for obj in context.selected_objects if obj.type == 'MESH']
|
||||||
|
|
||||||
|
if self.style == 'BLEND' and len(mesh_objects) != 2:
|
||||||
|
self.report({'ERROR'}, "Select two mesh objects.")
|
||||||
|
return {'CANCELLED'}
|
||||||
|
elif not mesh_objects:
|
||||||
|
self.report({'ERROR'}, "Select at least one mesh object.")
|
||||||
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
for obj in mesh_objects:
|
||||||
|
if len(obj.particle_systems) > 0:
|
||||||
|
self.report({'ERROR'}, "Selected object's can't have particle systems.")
|
||||||
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
if self.fade:
|
||||||
|
tex = bpy.data.textures.new("Explode fade", 'BLEND')
|
||||||
|
tex.use_color_ramp = True
|
||||||
|
|
||||||
|
if self.style == 'BLEND':
|
||||||
|
tex.color_ramp.elements[0].position = 0.333
|
||||||
|
tex.color_ramp.elements[1].position = 0.666
|
||||||
|
|
||||||
|
tex.color_ramp.elements[0].color[3] = 1
|
||||||
|
tex.color_ramp.elements[1].color[3] = 0
|
||||||
|
|
||||||
|
if self.style == 'BLEND':
|
||||||
|
if self.invert_order:
|
||||||
|
from_obj = mesh_objects[1]
|
||||||
|
to_obj = mesh_objects[0]
|
||||||
|
else:
|
||||||
|
from_obj = mesh_objects[0]
|
||||||
|
to_obj = mesh_objects[1]
|
||||||
|
|
||||||
|
for obj in mesh_objects:
|
||||||
|
fake_context["object"] = obj
|
||||||
|
bpy.ops.object.particle_system_add(fake_context)
|
||||||
|
|
||||||
|
settings = obj.particle_systems[-1].settings
|
||||||
|
settings.count = self.amount
|
||||||
|
settings.frame_start = self.start_frame
|
||||||
|
settings.frame_end = self.end_frame - self.duration
|
||||||
|
settings.lifetime = self.duration
|
||||||
|
settings.normal_factor = self.velocity
|
||||||
|
settings.render_type = 'NONE'
|
||||||
|
|
||||||
|
bpy.ops.object.modifier_add(fake_context, type='EXPLODE')
|
||||||
|
explode = obj.modifiers[-1]
|
||||||
|
explode.use_edge_cut = True
|
||||||
|
|
||||||
|
if self.fade:
|
||||||
|
explode.show_dead = False
|
||||||
|
bpy.ops.mesh.uv_texture_add(fake_context);
|
||||||
|
uv = obj.data.uv_textures[-1]
|
||||||
|
uv.name = "Explode fade"
|
||||||
|
explode.particle_uv = uv.name
|
||||||
|
|
||||||
|
if len(obj.material_slots) == 0:
|
||||||
|
obj.data.materials.append(bpy.data.materials.new("Explode fade"))
|
||||||
|
|
||||||
|
mat = obj.data.materials[0]
|
||||||
|
mat.use_transparency = True
|
||||||
|
mat.use_transparent_shadows = True
|
||||||
|
mat.alpha = 0
|
||||||
|
mat.specular_alpha = 0
|
||||||
|
|
||||||
|
tex_slot = mat.texture_slots.add()
|
||||||
|
|
||||||
|
tex_slot.texture = tex
|
||||||
|
tex_slot.texture_coords = 'UV'
|
||||||
|
tex_slot.uv_layer = uv.name
|
||||||
|
|
||||||
|
tex_slot.use_map_alpha = True
|
||||||
|
|
||||||
|
if self.style == 'BLEND':
|
||||||
|
if obj == to_obj:
|
||||||
|
tex_slot.alpha_factor = -1
|
||||||
|
elem = tex.color_ramp.elements[1]
|
||||||
|
elem.color[0] = mat.diffuse_color[0]
|
||||||
|
elem.color[1] = mat.diffuse_color[1]
|
||||||
|
elem.color[2] = mat.diffuse_color[2]
|
||||||
|
else:
|
||||||
|
elem = tex.color_ramp.elements[0]
|
||||||
|
elem.color[0] = mat.diffuse_color[0]
|
||||||
|
elem.color[1] = mat.diffuse_color[1]
|
||||||
|
elem.color[2] = mat.diffuse_color[2]
|
||||||
|
else:
|
||||||
|
tex_slot.use_map_color_diffuse = False
|
||||||
|
|
||||||
|
if self.style == 'BLEND':
|
||||||
|
settings.physics_type = 'KEYED'
|
||||||
|
settings.use_emit_random = False
|
||||||
|
settings.rotation_mode = 'NOR'
|
||||||
|
|
||||||
|
psys = obj.particle_systems[-1]
|
||||||
|
|
||||||
|
fake_context["particle_system"] = obj.particle_systems[-1]
|
||||||
|
bpy.ops.particle.new_target(fake_context)
|
||||||
|
bpy.ops.particle.new_target(fake_context)
|
||||||
|
|
||||||
|
if obj == from_obj:
|
||||||
|
psys.targets[1].object = to_obj
|
||||||
|
else:
|
||||||
|
psys.targets[0].object = from_obj
|
||||||
|
settings.normal_factor = -self.velocity
|
||||||
|
explode.show_unborn = False
|
||||||
|
explode.show_dead = True
|
||||||
|
else:
|
||||||
|
settings.factor_random = self.velocity
|
||||||
|
settings.angular_velocity_factor = self.velocity/10
|
||||||
|
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
def obj_bb_minmax(obj, min_co, max_co):
|
def obj_bb_minmax(obj, min_co, max_co):
|
||||||
for i in range(0, 8):
|
for i in range(0, 8):
|
||||||
@ -92,9 +240,9 @@ def obj_bb_minmax(obj, min_co, max_co):
|
|||||||
max_co[2] = max(bb_vec[2], max_co[2])
|
max_co[2] = max(bb_vec[2], max_co[2])
|
||||||
|
|
||||||
|
|
||||||
class MakeSmoke(bpy.types.Operator):
|
class QuickSmoke(bpy.types.Operator):
|
||||||
bl_idname = "object.make_smoke"
|
bl_idname = "object.quick_smoke"
|
||||||
bl_label = "Make Smoke"
|
bl_label = "Quick Smoke"
|
||||||
bl_options = {'REGISTER', 'UNDO'}
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
style = EnumProperty(items=(
|
style = EnumProperty(items=(
|
||||||
@ -201,9 +349,9 @@ class MakeSmoke(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
class MakeFluid(bpy.types.Operator):
|
class QuickFluid(bpy.types.Operator):
|
||||||
bl_idname = "object.make_fluid"
|
bl_idname = "object.quick_fluid"
|
||||||
bl_label = "Make Fluid"
|
bl_label = "Quick Fluid"
|
||||||
bl_options = {'REGISTER', 'UNDO'}
|
bl_options = {'REGISTER', 'UNDO'}
|
||||||
|
|
||||||
style = EnumProperty(items=(
|
style = EnumProperty(items=(
|
||||||
@ -293,4 +441,4 @@ class MakeFluid(bpy.types.Operator):
|
|||||||
if self.start_baking:
|
if self.start_baking:
|
||||||
bpy.ops.fluid.bake()
|
bpy.ops.fluid.bake()
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
@ -483,11 +483,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
|||||||
col.label(text="Mode:")
|
col.label(text="Mode:")
|
||||||
col.prop(md, "wrap_method", text="")
|
col.prop(md, "wrap_method", text="")
|
||||||
|
|
||||||
split = layout.split(percentage=0.25)
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
|
|
||||||
if md.wrap_method == 'PROJECT':
|
if md.wrap_method == 'PROJECT':
|
||||||
|
split = layout.split(percentage=0.25)
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
col.label(text="Axis:")
|
col.label(text="Axis:")
|
||||||
col.prop(md, "use_project_x")
|
col.prop(md, "use_project_x")
|
||||||
col.prop(md, "use_project_y")
|
col.prop(md, "use_project_y")
|
||||||
@ -499,7 +498,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
|||||||
col.prop(md, "use_positive_direction")
|
col.prop(md, "use_positive_direction")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
|
|
||||||
col.label(text="Cull Faces:")
|
col.label(text="Cull Faces:")
|
||||||
col.prop(md, "cull_face", expand=True)
|
col.prop(md, "cull_face", expand=True)
|
||||||
|
|
||||||
|
@ -376,8 +376,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
|
|||||||
col.prop(rd, "use_compositing")
|
col.prop(rd, "use_compositing")
|
||||||
col.prop(rd, "use_sequencer")
|
col.prop(rd, "use_sequencer")
|
||||||
|
|
||||||
col = split.column()
|
split.prop(rd, "dither_intensity", text="Dither", slider=True)
|
||||||
col.prop(rd, "dither_intensity", text="Dither", slider=True)
|
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
@ -300,6 +300,8 @@ void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, in
|
|||||||
|
|
||||||
void psys_check_boid_data(struct ParticleSystem *psys);
|
void psys_check_boid_data(struct ParticleSystem *psys);
|
||||||
|
|
||||||
|
void psys_get_birth_coordinates(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra);
|
||||||
|
|
||||||
void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys);
|
void particle_system_update(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys);
|
||||||
|
|
||||||
/* ----------- functions needed only inside particlesystem ------------ */
|
/* ----------- functions needed only inside particlesystem ------------ */
|
||||||
|
@ -493,7 +493,7 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co,
|
|||||||
|
|
||||||
// NOTE: casts to "float*" here are due to co being "const float*"
|
// NOTE: casts to "float*" here are due to co being "const float*"
|
||||||
closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
|
closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
|
||||||
dist = len_v3v3(nearest_tmp, (float*)co);
|
dist = len_squared_v3v3(nearest_tmp, (float*)co);
|
||||||
|
|
||||||
if(dist < nearest->dist)
|
if(dist < nearest->dist)
|
||||||
{
|
{
|
||||||
|
@ -1562,8 +1562,7 @@ static void initialize_all_particles(ParticleSimulationData *sim)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* sets particle to the emitter surface with initial velocity & rotation */
|
void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra)
|
||||||
void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
|
|
||||||
{
|
{
|
||||||
Object *ob = sim->ob;
|
Object *ob = sim->ob;
|
||||||
ParticleSystem *psys = sim->psys;
|
ParticleSystem *psys = sim->psys;
|
||||||
@ -1575,17 +1574,6 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
float q_phase[4];
|
float q_phase[4];
|
||||||
int p = pa - psys->particles;
|
int p = pa - psys->particles;
|
||||||
part=psys->part;
|
part=psys->part;
|
||||||
|
|
||||||
/* get precise emitter matrix if particle is born */
|
|
||||||
if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
|
|
||||||
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
|
|
||||||
while(ob) {
|
|
||||||
BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
|
|
||||||
ob = ob->parent;
|
|
||||||
}
|
|
||||||
ob = sim->ob;
|
|
||||||
where_is_object_time(sim->scene, ob, pa->time);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* get birth location from object */
|
/* get birth location from object */
|
||||||
if(part->tanfac != 0.f)
|
if(part->tanfac != 0.f)
|
||||||
@ -1594,7 +1582,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
|
psys_particle_on_emitter(sim->psmd, part->from,pa->num, pa->num_dmcache, pa->fuv,pa->foffset,loc,nor,0,0,0,0);
|
||||||
|
|
||||||
/* get possible textural influence */
|
/* get possible textural influence */
|
||||||
psys_get_texture(sim, pa, &ptex, PAMAP_IVEL|PAMAP_LIFE, cfra);
|
psys_get_texture(sim, pa, &ptex, PAMAP_IVEL, cfra);
|
||||||
|
|
||||||
/* particles live in global space so */
|
/* particles live in global space so */
|
||||||
/* let's convert: */
|
/* let's convert: */
|
||||||
@ -1654,37 +1642,27 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
mat4_to_quat(rot,ob->obmat);
|
mat4_to_quat(rot,ob->obmat);
|
||||||
mul_qt_qtqt(r_rot,r_rot,rot);
|
mul_qt_qtqt(r_rot,r_rot,rot);
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
|
if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
|
||||||
BoidParticle *bpa = pa->boid;
|
|
||||||
float dvec[3], q[4], mat[3][3];
|
float dvec[3], q[4], mat[3][3];
|
||||||
|
|
||||||
copy_v3_v3(pa->state.co,loc);
|
copy_v3_v3(state->co,loc);
|
||||||
|
|
||||||
/* boids don't get any initial velocity */
|
/* boids don't get any initial velocity */
|
||||||
zero_v3(pa->state.vel);
|
zero_v3(state->vel);
|
||||||
|
|
||||||
/* boids store direction in ave */
|
/* boids store direction in ave */
|
||||||
if(fabsf(nor[2])==1.0f) {
|
if(fabsf(nor[2])==1.0f) {
|
||||||
sub_v3_v3v3(pa->state.ave, loc, ob->obmat[3]);
|
sub_v3_v3v3(state->ave, loc, ob->obmat[3]);
|
||||||
normalize_v3(pa->state.ave);
|
normalize_v3(state->ave);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(pa->state.ave, nor);
|
VECCOPY(state->ave, nor);
|
||||||
}
|
}
|
||||||
/* and gravity in r_ve */
|
|
||||||
bpa->gravity[0] = bpa->gravity[1] = 0.0f;
|
|
||||||
bpa->gravity[2] = -1.0f;
|
|
||||||
if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
|
|
||||||
&& sim->scene->physics_settings.gravity[2]!=0.0f)
|
|
||||||
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
|
|
||||||
|
|
||||||
/* calculate rotation matrix */
|
/* calculate rotation matrix */
|
||||||
project_v3_v3v3(dvec, r_vel, pa->state.ave);
|
project_v3_v3v3(dvec, r_vel, state->ave);
|
||||||
sub_v3_v3v3(mat[0], pa->state.ave, dvec);
|
sub_v3_v3v3(mat[0], state->ave, dvec);
|
||||||
normalize_v3(mat[0]);
|
normalize_v3(mat[0]);
|
||||||
negate_v3_v3(mat[2], r_vel);
|
negate_v3_v3(mat[2], r_vel);
|
||||||
normalize_v3(mat[2]);
|
normalize_v3(mat[2]);
|
||||||
@ -1692,12 +1670,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
|
|
||||||
/* apply rotation */
|
/* apply rotation */
|
||||||
mat3_to_quat_is_ok( q,mat);
|
mat3_to_quat_is_ok( q,mat);
|
||||||
copy_qt_qt(pa->state.rot, q);
|
copy_qt_qt(state->rot, q);
|
||||||
|
|
||||||
bpa->data.health = part->boids->health;
|
|
||||||
bpa->data.mode = eBoidMode_InAir;
|
|
||||||
bpa->data.state_id = ((BoidState*)part->boids->states.first)->id;
|
|
||||||
bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* conversion done so now we apply new: */
|
/* conversion done so now we apply new: */
|
||||||
@ -1710,7 +1683,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
|
|
||||||
/* *emitter velocity */
|
/* *emitter velocity */
|
||||||
if(dtime != 0.f && part->obfac != 0.f){
|
if(dtime != 0.f && part->obfac != 0.f){
|
||||||
sub_v3_v3v3(vel, loc, pa->state.co);
|
sub_v3_v3v3(vel, loc, state->co);
|
||||||
mul_v3_fl(vel, part->obfac/dtime);
|
mul_v3_fl(vel, part->obfac/dtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1747,13 +1720,13 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
if(part->partfac != 0.f)
|
if(part->partfac != 0.f)
|
||||||
madd_v3_v3fl(vel, p_vel, part->partfac);
|
madd_v3_v3fl(vel, p_vel, part->partfac);
|
||||||
|
|
||||||
mul_v3_v3fl(pa->state.vel, vel, ptex.ivel);
|
mul_v3_v3fl(state->vel, vel, ptex.ivel);
|
||||||
|
|
||||||
/* -location from emitter */
|
/* -location from emitter */
|
||||||
copy_v3_v3(pa->state.co,loc);
|
copy_v3_v3(state->co,loc);
|
||||||
|
|
||||||
/* -rotation */
|
/* -rotation */
|
||||||
unit_qt(pa->state.rot);
|
unit_qt(state->rot);
|
||||||
|
|
||||||
if(part->rotmode){
|
if(part->rotmode){
|
||||||
/* create vector into which rotation is aligned */
|
/* create vector into which rotation is aligned */
|
||||||
@ -1793,32 +1766,74 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
|
|||||||
axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
|
axis_angle_to_quat( q_phase,x_vec, phasefac*(float)M_PI);
|
||||||
|
|
||||||
/* combine base rotation & phase */
|
/* combine base rotation & phase */
|
||||||
mul_qt_qtqt(pa->state.rot, rot, q_phase);
|
mul_qt_qtqt(state->rot, rot, q_phase);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -angular velocity */
|
/* -angular velocity */
|
||||||
|
|
||||||
zero_v3(pa->state.ave);
|
zero_v3(state->ave);
|
||||||
|
|
||||||
if(part->avemode){
|
if(part->avemode){
|
||||||
switch(part->avemode){
|
switch(part->avemode){
|
||||||
case PART_AVE_SPIN:
|
case PART_AVE_SPIN:
|
||||||
copy_v3_v3(pa->state.ave, vel);
|
copy_v3_v3(state->ave, vel);
|
||||||
break;
|
break;
|
||||||
case PART_AVE_RAND:
|
case PART_AVE_RAND:
|
||||||
copy_v3_v3(pa->state.ave, r_ave);
|
copy_v3_v3(state->ave, r_ave);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
normalize_v3(pa->state.ave);
|
normalize_v3(state->ave);
|
||||||
mul_v3_fl(pa->state.ave,part->avefac);
|
mul_v3_fl(state->ave, part->avefac);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
/* sets particle to the emitter surface with initial velocity & rotation */
|
||||||
|
void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
|
||||||
|
{
|
||||||
|
Object *ob = sim->ob;
|
||||||
|
ParticleSystem *psys = sim->psys;
|
||||||
|
ParticleSettings *part;
|
||||||
|
ParticleTexture ptex;
|
||||||
|
int p = pa - psys->particles;
|
||||||
|
part=psys->part;
|
||||||
|
|
||||||
|
/* get precise emitter matrix if particle is born */
|
||||||
|
if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
|
||||||
|
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
|
||||||
|
while(ob) {
|
||||||
|
BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
|
||||||
|
ob = ob->parent;
|
||||||
|
}
|
||||||
|
ob = sim->ob;
|
||||||
|
where_is_object_time(sim->scene, ob, pa->time);
|
||||||
|
}
|
||||||
|
|
||||||
|
psys_get_birth_coordinates(sim, pa, &pa->state, dtime, cfra);
|
||||||
|
|
||||||
|
if(part->phystype==PART_PHYS_BOIDS && pa->boid) {
|
||||||
|
BoidParticle *bpa = pa->boid;
|
||||||
|
|
||||||
|
/* and gravity in r_ve */
|
||||||
|
bpa->gravity[0] = bpa->gravity[1] = 0.0f;
|
||||||
|
bpa->gravity[2] = -1.0f;
|
||||||
|
if((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY)
|
||||||
|
&& sim->scene->physics_settings.gravity[2]!=0.0f)
|
||||||
|
bpa->gravity[2] = sim->scene->physics_settings.gravity[2];
|
||||||
|
|
||||||
|
bpa->data.health = part->boids->health;
|
||||||
|
bpa->data.mode = eBoidMode_InAir;
|
||||||
|
bpa->data.state_id = ((BoidState*)part->boids->states.first)->id;
|
||||||
|
bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(part->type == PART_HAIR){
|
if(part->type == PART_HAIR){
|
||||||
pa->lifetime = 100.0f;
|
pa->lifetime = 100.0f;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
/* get possible textural influence */
|
||||||
|
psys_get_texture(sim, pa, &ptex, PAMAP_LIFE, cfra);
|
||||||
|
|
||||||
pa->lifetime = part->lifetime * ptex.life;
|
pa->lifetime = part->lifetime * ptex.life;
|
||||||
|
|
||||||
if(part->randlife != 0.0f)
|
if(part->randlife != 0.0f)
|
||||||
@ -1904,6 +1919,7 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
|||||||
PARTICLE_P;
|
PARTICLE_P;
|
||||||
ParticleKey *key;
|
ParticleKey *key;
|
||||||
int totpart = psys->totpart, k, totkeys = psys->totkeyed;
|
int totpart = psys->totpart, k, totkeys = psys->totkeyed;
|
||||||
|
int keyed_flag = 0;
|
||||||
|
|
||||||
ksim.scene= sim->scene;
|
ksim.scene= sim->scene;
|
||||||
|
|
||||||
@ -1933,6 +1949,8 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
|||||||
for(k=0; k<totkeys; k++) {
|
for(k=0; k<totkeys; k++) {
|
||||||
ksim.ob = pt->ob ? pt->ob : sim->ob;
|
ksim.ob = pt->ob ? pt->ob : sim->ob;
|
||||||
ksim.psys = BLI_findlink(&ksim.ob->particlesystem, pt->psys - 1);
|
ksim.psys = BLI_findlink(&ksim.ob->particlesystem, pt->psys - 1);
|
||||||
|
keyed_flag = (ksim.psys->flag & PSYS_KEYED);
|
||||||
|
ksim.psys->flag &= ~PSYS_KEYED;
|
||||||
|
|
||||||
LOOP_PARTICLES {
|
LOOP_PARTICLES {
|
||||||
key = pa->keys + k;
|
key = pa->keys + k;
|
||||||
@ -1956,6 +1974,8 @@ static void set_keyed_keys(ParticleSimulationData *sim)
|
|||||||
if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
|
if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f)
|
||||||
k++;
|
k++;
|
||||||
|
|
||||||
|
ksim.psys->flag |= keyed_flag;
|
||||||
|
|
||||||
pt = (pt->next && pt->next->flag & PTARGET_VALID)? pt->next : psys->targets.first;
|
pt = (pt->next && pt->next->flag & PTARGET_VALID)? pt->next : psys->targets.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2326,39 +2326,43 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
|||||||
wtb.outline= 0;
|
wtb.outline= 0;
|
||||||
widgetbase_draw(&wtb, wcol);
|
widgetbase_draw(&wtb, wcol);
|
||||||
|
|
||||||
/* slider part */
|
/* draw left/right parts only when not in text editing */
|
||||||
VECCOPY(outline, wcol->outline);
|
if(!(state & UI_TEXTINPUT)) {
|
||||||
VECCOPY(wcol->outline, wcol->item);
|
|
||||||
VECCOPY(wcol->inner, wcol->item);
|
/* slider part */
|
||||||
|
VECCOPY(outline, wcol->outline);
|
||||||
|
VECCOPY(wcol->outline, wcol->item);
|
||||||
|
VECCOPY(wcol->inner, wcol->item);
|
||||||
|
|
||||||
if(!(state & UI_SELECT))
|
if(!(state & UI_SELECT))
|
||||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||||
|
|
||||||
rect1= *rect;
|
rect1= *rect;
|
||||||
|
|
||||||
value= ui_get_but_val(but);
|
value= ui_get_but_val(but);
|
||||||
fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
|
fac= ((float)value-but->softmin)*(rect1.xmax - rect1.xmin - offs)/(but->softmax - but->softmin);
|
||||||
|
|
||||||
/* left part of slider, always rounded */
|
/* left part of slider, always rounded */
|
||||||
rect1.xmax= rect1.xmin + ceil(offs+1.0f);
|
rect1.xmax= rect1.xmin + ceil(offs+1.0f);
|
||||||
round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
|
round_box_edges(&wtb1, roundboxalign & ~6, &rect1, offs);
|
||||||
wtb1.outline= 0;
|
wtb1.outline= 0;
|
||||||
widgetbase_draw(&wtb1, wcol);
|
widgetbase_draw(&wtb1, wcol);
|
||||||
|
|
||||||
/* right part of slider, interpolate roundness */
|
/* right part of slider, interpolate roundness */
|
||||||
rect1.xmax= rect1.xmin + fac + offs;
|
rect1.xmax= rect1.xmin + fac + offs;
|
||||||
rect1.xmin+= floor(offs-1.0f);
|
rect1.xmin+= floor(offs-1.0f);
|
||||||
if(rect1.xmax + offs > rect->xmax)
|
if(rect1.xmax + offs > rect->xmax)
|
||||||
offs*= (rect1.xmax + offs - rect->xmax)/offs;
|
offs*= (rect1.xmax + offs - rect->xmax)/offs;
|
||||||
else
|
else
|
||||||
offs= 0.0f;
|
offs= 0.0f;
|
||||||
round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
|
round_box_edges(&wtb1, roundboxalign & ~9, &rect1, offs);
|
||||||
|
|
||||||
widgetbase_draw(&wtb1, wcol);
|
widgetbase_draw(&wtb1, wcol);
|
||||||
VECCOPY(wcol->outline, outline);
|
VECCOPY(wcol->outline, outline);
|
||||||
|
|
||||||
if(!(state & UI_SELECT))
|
if(!(state & UI_SELECT))
|
||||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||||
|
}
|
||||||
|
|
||||||
/* outline */
|
/* outline */
|
||||||
wtb.outline= 1;
|
wtb.outline= 1;
|
||||||
|
@ -3967,6 +3967,7 @@ short sharesFace(EditMesh *em, EditEdge* e1, EditEdge* e2)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
typedef struct SlideUv {
|
typedef struct SlideUv {
|
||||||
float origuv[2];
|
float origuv[2];
|
||||||
@ -3980,7 +3981,6 @@ typedef struct SlideVert {
|
|||||||
EditVert origvert;
|
EditVert origvert;
|
||||||
} SlideVert;
|
} SlideVert;
|
||||||
|
|
||||||
#if 0
|
|
||||||
int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc)
|
int EdgeSlide(EditMesh *em, wmOperator *op, short immediate, float imperc)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -302,6 +302,9 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
|
|||||||
BLI_timestr(rs->lastframetime, info_time_str);
|
BLI_timestr(rs->lastframetime, info_time_str);
|
||||||
spos+= sprintf(spos, "Time:%s ", info_time_str);
|
spos+= sprintf(spos, "Time:%s ", info_time_str);
|
||||||
|
|
||||||
|
if(rs->curfsa)
|
||||||
|
spos+= sprintf(spos, "| Full Sample %d ", rs->curfsa);
|
||||||
|
|
||||||
if(rs->infostr && rs->infostr[0])
|
if(rs->infostr && rs->infostr[0])
|
||||||
spos+= sprintf(spos, "| %s ", rs->infostr);
|
spos+= sprintf(spos, "| %s ", rs->infostr);
|
||||||
|
|
||||||
|
@ -3559,7 +3559,7 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_FINISHED;
|
return OPERATOR_FINISHED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sculpt_brush_stroke_cacel(bContext *C, wmOperator *op)
|
static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
|
||||||
{
|
{
|
||||||
Object *ob= CTX_data_active_object(C);
|
Object *ob= CTX_data_active_object(C);
|
||||||
SculptSession *ss = ob->sculpt;
|
SculptSession *ss = ob->sculpt;
|
||||||
@ -3595,7 +3595,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
|
|||||||
ot->modal= paint_stroke_modal;
|
ot->modal= paint_stroke_modal;
|
||||||
ot->exec= sculpt_brush_stroke_exec;
|
ot->exec= sculpt_brush_stroke_exec;
|
||||||
ot->poll= sculpt_poll;
|
ot->poll= sculpt_poll;
|
||||||
ot->cancel= sculpt_brush_stroke_cacel;
|
ot->cancel= sculpt_brush_stroke_cancel;
|
||||||
|
|
||||||
/* flags (sculpt does own undo? (ton) */
|
/* flags (sculpt does own undo? (ton) */
|
||||||
ot->flag= OPTYPE_BLOCKING;
|
ot->flag= OPTYPE_BLOCKING;
|
||||||
|
@ -83,11 +83,13 @@ typedef struct ConsoleDrawContext {
|
|||||||
int console_width;
|
int console_width;
|
||||||
int winx;
|
int winx;
|
||||||
int ymin, ymax;
|
int ymin, ymax;
|
||||||
|
#if 0 /* used by textview, may use later */
|
||||||
int *xy; // [2]
|
int *xy; // [2]
|
||||||
int *sel; // [2]
|
int *sel; // [2]
|
||||||
int *pos_pick; // bottom of view == 0, top of file == combine chars, end of line is lower then start.
|
int *pos_pick; // bottom of view == 0, top of file == combine chars, end of line is lower then start.
|
||||||
int *mval; // [2]
|
int *mval; // [2]
|
||||||
int draw;
|
int draw;
|
||||||
|
#endif
|
||||||
} ConsoleDrawContext;
|
} ConsoleDrawContext;
|
||||||
|
|
||||||
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy)
|
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy)
|
||||||
|
@ -662,7 +662,6 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
|||||||
|
|
||||||
block= uiLayoutGetBlock(layout);
|
block= uiLayoutGetBlock(layout);
|
||||||
|
|
||||||
|
|
||||||
imaptr= RNA_property_pointer_get(ptr, prop);
|
imaptr= RNA_property_pointer_get(ptr, prop);
|
||||||
ima= imaptr.data;
|
ima= imaptr.data;
|
||||||
iuser= userptr->data;
|
iuser= userptr->data;
|
||||||
@ -719,21 +718,17 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
row= uiLayoutRow(layout, 0);
|
uiItemR(layout, &imaptr, "source", 0, NULL, ICON_NONE);
|
||||||
uiItemR(row, &imaptr, "source", 0, NULL, ICON_NONE);
|
|
||||||
|
|
||||||
if(ima->source != IMA_SRC_GENERATED) {
|
if(ima->source != IMA_SRC_GENERATED) {
|
||||||
row= uiLayoutRow(layout, 1);
|
row= uiLayoutRow(layout, 1);
|
||||||
split = uiLayoutSplit(row, 0.0, 0);
|
|
||||||
if (ima->packedfile)
|
if (ima->packedfile)
|
||||||
uiItemO(split, "", ICON_PACKAGE, "image.unpack");
|
uiItemO(row, "", ICON_PACKAGE, "image.unpack");
|
||||||
else
|
else
|
||||||
uiItemO(split, "", ICON_UGLYPACKAGE, "image.pack");
|
uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack");
|
||||||
|
|
||||||
split = uiLayoutSplit(row, 0.0, 0);
|
row= uiLayoutRow(row, 0);
|
||||||
row= uiLayoutRow(split, 1);
|
|
||||||
uiLayoutSetEnabled(row, ima->packedfile==NULL);
|
uiLayoutSetEnabled(row, ima->packedfile==NULL);
|
||||||
|
|
||||||
uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE);
|
uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE);
|
||||||
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
|
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
|
||||||
}
|
}
|
||||||
@ -771,11 +766,10 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
|||||||
col= uiLayoutColumn(split, 0);
|
col= uiLayoutColumn(split, 0);
|
||||||
uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE);
|
uiItemR(col, &imaptr, "use_fields", 0, NULL, ICON_NONE);
|
||||||
row= uiLayoutRow(col, 0);
|
row= uiLayoutRow(col, 0);
|
||||||
uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
||||||
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields"));
|
uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "use_fields"));
|
||||||
|
uiItemR(row, &imaptr, "field_order", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
||||||
col= uiLayoutColumn(split, 0);
|
|
||||||
uiItemR(col, &imaptr, "use_premultiply", 0, NULL, ICON_NONE);
|
uiItemR(split, &imaptr, "use_premultiply", 0, NULL, ICON_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -787,10 +781,9 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
|||||||
col= uiLayoutColumn(split, 0);
|
col= uiLayoutColumn(split, 0);
|
||||||
|
|
||||||
sprintf(str, "(%d) Frames", iuser->framenr);
|
sprintf(str, "(%d) Frames", iuser->framenr);
|
||||||
row= uiLayoutRow(col, 1);
|
|
||||||
uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE);
|
uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE);
|
||||||
if(ima->anim) {
|
if(ima->anim) {
|
||||||
block= uiLayoutGetBlock(row);
|
block= uiLayoutGetBlock(col);
|
||||||
but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence.");
|
but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence.");
|
||||||
uiButSetFunc(but, set_frames_cb, ima, iuser);
|
uiButSetFunc(but, set_frames_cb, ima, iuser);
|
||||||
}
|
}
|
||||||
@ -810,8 +803,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
|
|||||||
uiItemR(col, &imaptr, "generated_width", 0, "X", ICON_NONE);
|
uiItemR(col, &imaptr, "generated_width", 0, "X", ICON_NONE);
|
||||||
uiItemR(col, &imaptr, "generated_height", 0, "Y", ICON_NONE);
|
uiItemR(col, &imaptr, "generated_height", 0, "Y", ICON_NONE);
|
||||||
|
|
||||||
col= uiLayoutColumn(split, 0);
|
uiItemR(split, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
||||||
uiItemR(col, &imaptr, "generated_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1366,10 +1366,17 @@ static int node_resize_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|||||||
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
|
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
|
||||||
&snode->mx, &snode->my);
|
&snode->mx, &snode->my);
|
||||||
|
|
||||||
/* rect we're interested in is just the bottom right corner */
|
|
||||||
totr= node->totr;
|
totr= node->totr;
|
||||||
totr.xmin= totr.xmax-10.0f;
|
|
||||||
totr.ymax= totr.ymin+10.0f;
|
if(node->flag & NODE_HIDDEN) {
|
||||||
|
/* right part of node */
|
||||||
|
totr.xmin= node->totr.xmax-20.0f;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* bottom right corner */
|
||||||
|
totr.xmin= totr.xmax-10.0f;
|
||||||
|
totr.ymax= totr.ymin+10.0f;
|
||||||
|
}
|
||||||
|
|
||||||
if(BLI_in_rctf(&totr, snode->mx, snode->my)) {
|
if(BLI_in_rctf(&totr, snode->mx, snode->my)) {
|
||||||
NodeSizeWidget *nsw= MEM_callocN(sizeof(NodeSizeWidget), "size widget op data");
|
NodeSizeWidget *nsw= MEM_callocN(sizeof(NodeSizeWidget), "size widget op data");
|
||||||
|
@ -124,7 +124,7 @@ typedef struct TransSeq {
|
|||||||
int startstill, endstill;
|
int startstill, endstill;
|
||||||
int startdisp, enddisp;
|
int startdisp, enddisp;
|
||||||
int startofs, endofs;
|
int startofs, endofs;
|
||||||
int final_left, final_right;
|
/* int final_left, final_right; */ /* UNUSED */
|
||||||
int len;
|
int len;
|
||||||
} TransSeq;
|
} TransSeq;
|
||||||
|
|
||||||
|
@ -253,19 +253,12 @@ typedef struct RenderData {
|
|||||||
*/
|
*/
|
||||||
short yparts;
|
short yparts;
|
||||||
|
|
||||||
short winpos, planes, imtype, subimtype;
|
short planes, imtype, subimtype, quality;
|
||||||
|
|
||||||
/** Mode bits: */
|
|
||||||
/* 0: Enable backbuffering for images */
|
|
||||||
short bufflag;
|
|
||||||
short quality;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render to image editor, fullscreen or to new window.
|
* Render to image editor, fullscreen or to new window.
|
||||||
*/
|
*/
|
||||||
short displaymode;
|
short displaymode;
|
||||||
|
|
||||||
short rpad1, rpad2;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flags for render settings. Use bit-masking to access the settings.
|
* Flags for render settings. Use bit-masking to access the settings.
|
||||||
@ -322,11 +315,7 @@ typedef struct RenderData {
|
|||||||
/**
|
/**
|
||||||
* Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
|
* Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
|
||||||
*/
|
*/
|
||||||
float xasp;
|
float xasp, yasp;
|
||||||
/**
|
|
||||||
* Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
|
|
||||||
*/
|
|
||||||
float yasp;
|
|
||||||
|
|
||||||
float frs_sec_base;
|
float frs_sec_base;
|
||||||
|
|
||||||
@ -349,7 +338,7 @@ typedef struct RenderData {
|
|||||||
short bake_normal_space, bake_quad_split;
|
short bake_normal_space, bake_quad_split;
|
||||||
float bake_maxdist, bake_biasdist, bake_pad;
|
float bake_maxdist, bake_biasdist, bake_pad;
|
||||||
|
|
||||||
/* paths to backbufffer, output */
|
/* path to render output */
|
||||||
char pic[240];
|
char pic[240];
|
||||||
|
|
||||||
/* stamps flags. */
|
/* stamps flags. */
|
||||||
|
@ -87,6 +87,20 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rna_Controller_mode_set(struct PointerRNA *ptr, int value)
|
||||||
|
{
|
||||||
|
bController *cont= (bController *)ptr->data;
|
||||||
|
bPythonCont *pycon= (bPythonCont *)cont->data;
|
||||||
|
|
||||||
|
// if mode changed and previous mode were Script
|
||||||
|
if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT)
|
||||||
|
{
|
||||||
|
// clear script to avoid it to get linked with the controller
|
||||||
|
pycon->text = NULL;
|
||||||
|
}
|
||||||
|
pycon->mode = value;
|
||||||
|
}
|
||||||
|
|
||||||
static int rna_Controller_state_number_get(struct PointerRNA *ptr)
|
static int rna_Controller_state_number_get(struct PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
bController *cont= (bController *)ptr->data;
|
bController *cont= (bController *)ptr->data;
|
||||||
@ -222,6 +236,7 @@ void RNA_def_controller(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
|
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
|
||||||
RNA_def_property_enum_items(prop, python_controller_modes);
|
RNA_def_property_enum_items(prop, python_controller_modes);
|
||||||
|
RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL);
|
||||||
RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
|
RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
|
||||||
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
RNA_def_property_update(prop, NC_LOGIC, NULL);
|
||||||
|
|
||||||
|
@ -245,6 +245,13 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN
|
|||||||
|
|
||||||
static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
|
/* if all lights are off gpu_draw resets them all, [#27627]
|
||||||
|
* so disallow them all to be disabled */
|
||||||
|
if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
|
||||||
|
SolidLight *light= ptr->data;
|
||||||
|
light->flag |= 1;
|
||||||
|
}
|
||||||
|
|
||||||
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
|
WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
|
||||||
rna_userdef_update(bmain, scene, ptr);
|
rna_userdef_update(bmain, scene, ptr);
|
||||||
}
|
}
|
||||||
|
@ -779,11 +779,11 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
|||||||
ParticleSettings *part=psmd->psys->part;
|
ParticleSettings *part=psmd->psys->part;
|
||||||
ParticleSimulationData sim= {NULL};
|
ParticleSimulationData sim= {NULL};
|
||||||
ParticleData *pa=NULL, *pars=psmd->psys->particles;
|
ParticleData *pa=NULL, *pars=psmd->psys->particles;
|
||||||
ParticleKey state;
|
ParticleKey state, birth;
|
||||||
EdgeHash *vertpahash;
|
EdgeHash *vertpahash;
|
||||||
EdgeHashIterator *ehi;
|
EdgeHashIterator *ehi;
|
||||||
float *vertco= NULL, imat[4][4];
|
float *vertco= NULL, imat[4][4];
|
||||||
float loc0[3], nor[3];
|
float rot[4];
|
||||||
float cfra;
|
float cfra;
|
||||||
/* float timestep; */
|
/* float timestep; */
|
||||||
int *facepa=emd->facepa;
|
int *facepa=emd->facepa;
|
||||||
@ -814,7 +814,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
|||||||
for (i=0; i<totface; i++) {
|
for (i=0; i<totface; i++) {
|
||||||
/* do mindex + totvert to ensure the vertex index to be the first
|
/* do mindex + totvert to ensure the vertex index to be the first
|
||||||
* with BLI_edgehashIterator_getKey */
|
* with BLI_edgehashIterator_getKey */
|
||||||
if(facepa[i]==totpart || cfra <= (pars+facepa[i])->time)
|
if(facepa[i]==totpart || cfra < (pars+facepa[i])->time)
|
||||||
mindex = totvert+totpart;
|
mindex = totvert+totpart;
|
||||||
else
|
else
|
||||||
mindex = totvert+facepa[i];
|
mindex = totvert+facepa[i];
|
||||||
@ -868,26 +868,26 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
|||||||
/* get particle */
|
/* get particle */
|
||||||
pa= pars+i;
|
pa= pars+i;
|
||||||
|
|
||||||
/* get particle state */
|
psys_get_birth_coordinates(&sim, pa, &birth, 0, 0);
|
||||||
psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc0,nor,NULL,NULL,NULL,NULL);
|
|
||||||
mul_m4_v3(ob->obmat,loc0);
|
|
||||||
|
|
||||||
state.time=cfra;
|
state.time=cfra;
|
||||||
psys_get_particle_state(&sim, i, &state, 1);
|
psys_get_particle_state(&sim, i, &state, 1);
|
||||||
|
|
||||||
vertco=CDDM_get_vert(explode,v)->co;
|
vertco=CDDM_get_vert(explode,v)->co;
|
||||||
|
|
||||||
mul_m4_v3(ob->obmat,vertco);
|
mul_m4_v3(ob->obmat,vertco);
|
||||||
|
|
||||||
VECSUB(vertco,vertco,loc0);
|
sub_v3_v3(vertco, birth.co);
|
||||||
|
|
||||||
/* apply rotation, size & location */
|
/* apply rotation, size & location */
|
||||||
mul_qt_v3(state.rot,vertco);
|
sub_qt_qtqt(rot, state.rot, birth.rot);
|
||||||
|
mul_qt_v3(rot, vertco);
|
||||||
|
|
||||||
if(emd->flag & eExplodeFlag_PaSize)
|
if(emd->flag & eExplodeFlag_PaSize)
|
||||||
mul_v3_fl(vertco,pa->size);
|
mul_v3_fl(vertco,pa->size);
|
||||||
VECADD(vertco,vertco,state.co);
|
|
||||||
|
|
||||||
mul_m4_v3(imat,vertco);
|
add_v3_v3(vertco, state.co);
|
||||||
|
|
||||||
|
mul_m4_v3(imat, vertco);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BLI_edgehashIterator_free(ehi);
|
BLI_edgehashIterator_free(ehi);
|
||||||
@ -911,7 +911,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
|
|||||||
|
|
||||||
orig_v4 = source.v4;
|
orig_v4 = source.v4;
|
||||||
|
|
||||||
if(facepa[i]!=totpart && cfra <= pa->time)
|
if(facepa[i]!=totpart && cfra < pa->time)
|
||||||
mindex = totvert+totpart;
|
mindex = totvert+totpart;
|
||||||
else
|
else
|
||||||
mindex = totvert+facepa[i];
|
mindex = totvert+facepa[i];
|
||||||
|
@ -146,7 +146,7 @@ typedef struct RenderResult {
|
|||||||
typedef struct RenderStats {
|
typedef struct RenderStats {
|
||||||
int cfra;
|
int cfra;
|
||||||
int totface, totvert, totstrand, tothalo, totlamp, totpart;
|
int totface, totvert, totstrand, tothalo, totlamp, totpart;
|
||||||
short curfield, curblur, curpart, partsdone, convertdone;
|
short curfield, curblur, curpart, partsdone, convertdone, curfsa;
|
||||||
double starttime, lastframetime;
|
double starttime, lastframetime;
|
||||||
const char *infostr, *statstr;
|
const char *infostr, *statstr;
|
||||||
char scenename[32];
|
char scenename[32];
|
||||||
|
@ -214,7 +214,7 @@ struct Render
|
|||||||
ListBase instancetable;
|
ListBase instancetable;
|
||||||
int totinstance;
|
int totinstance;
|
||||||
|
|
||||||
struct Image *backbuf, *bakebuf;
|
struct Image *bakebuf;
|
||||||
|
|
||||||
struct GHash *orco_hash;
|
struct GHash *orco_hash;
|
||||||
|
|
||||||
|
@ -4665,7 +4665,6 @@ void RE_Database_Free(Render *re)
|
|||||||
re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0;
|
re->totvlak=re->totvert=re->totstrand=re->totlamp=re->tothalo= 0;
|
||||||
re->i.convertdone= 0;
|
re->i.convertdone= 0;
|
||||||
|
|
||||||
re->backbuf= NULL;
|
|
||||||
re->bakebuf= NULL;
|
re->bakebuf= NULL;
|
||||||
|
|
||||||
if(re->scene)
|
if(re->scene)
|
||||||
|
@ -149,7 +149,6 @@ static Render *envmap_render_copy(Render *re, EnvMap *env)
|
|||||||
envre->r.layers.first= envre->r.layers.last= NULL;
|
envre->r.layers.first= envre->r.layers.last= NULL;
|
||||||
envre->r.filtertype= 0;
|
envre->r.filtertype= 0;
|
||||||
envre->r.xparts= envre->r.yparts= 2;
|
envre->r.xparts= envre->r.yparts= 2;
|
||||||
envre->r.bufflag= 0;
|
|
||||||
envre->r.size= 100;
|
envre->r.size= 100;
|
||||||
envre->r.yasp= envre->r.xasp= 1;
|
envre->r.yasp= envre->r.xasp= 1;
|
||||||
|
|
||||||
|
@ -2065,35 +2065,6 @@ static void do_render_fields_3d(Render *re)
|
|||||||
re->display_draw(re->ddh, re->result, NULL);
|
re->display_draw(re->ddh, re->result, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_backbuffer(Render *re)
|
|
||||||
{
|
|
||||||
if(re->r.alphamode == R_ADDSKY) {
|
|
||||||
ImBuf *ibuf;
|
|
||||||
char name[256];
|
|
||||||
|
|
||||||
BLI_path_abs(name, re->main->name);
|
|
||||||
BLI_path_frame(name, re->r.cfra, 0);
|
|
||||||
|
|
||||||
if(re->backbuf) {
|
|
||||||
re->backbuf->id.us--;
|
|
||||||
if(re->backbuf->id.us<1)
|
|
||||||
BKE_image_signal(re->backbuf, NULL, IMA_SIGNAL_RELOAD);
|
|
||||||
}
|
|
||||||
|
|
||||||
re->backbuf= BKE_add_image_file(name);
|
|
||||||
ibuf= BKE_image_get_ibuf(re->backbuf, NULL);
|
|
||||||
if(ibuf==NULL) {
|
|
||||||
// error() doesnt work with render window open
|
|
||||||
//error("No backbuf there!");
|
|
||||||
printf("Error: No backbuf %s\n", name);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (re->r.mode & R_FIELDS)
|
|
||||||
image_de_interlace(re->backbuf, re->r.mode & R_ODDFIELD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* main render routine, no compositing */
|
/* main render routine, no compositing */
|
||||||
static void do_render_fields_blur_3d(Render *re)
|
static void do_render_fields_blur_3d(Render *re)
|
||||||
{
|
{
|
||||||
@ -2104,10 +2075,6 @@ static void do_render_fields_blur_3d(Render *re)
|
|||||||
G.afbreek= 1;
|
G.afbreek= 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* backbuffer initialize */
|
|
||||||
if(re->r.bufflag & 1)
|
|
||||||
load_backbuffer(re);
|
|
||||||
|
|
||||||
/* now use renderdata and camera to set viewplane */
|
/* now use renderdata and camera to set viewplane */
|
||||||
RE_SetCamera(re, camera);
|
RE_SetCamera(re, camera);
|
||||||
@ -2202,6 +2169,24 @@ static void render_scene(Render *re, Scene *sce, int cfra)
|
|||||||
do_render_fields_blur_3d(resc);
|
do_render_fields_blur_3d(resc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* helper call to detect if this scene needs a render, or if there's a any render layer to render */
|
||||||
|
static int composite_needs_render(Scene *sce, int this_scene)
|
||||||
|
{
|
||||||
|
bNodeTree *ntree= sce->nodetree;
|
||||||
|
bNode *node;
|
||||||
|
|
||||||
|
if(ntree==NULL) return 1;
|
||||||
|
if(sce->use_nodes==0) return 1;
|
||||||
|
if((sce->r.scemode & R_DOCOMP)==0) return 1;
|
||||||
|
|
||||||
|
for(node= ntree->nodes.first; node; node= node->next) {
|
||||||
|
if(node->type==CMP_NODE_R_LAYERS)
|
||||||
|
if(this_scene==0 || node->id==NULL || node->id==&sce->id)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void tag_scenes_for_render(Render *re)
|
static void tag_scenes_for_render(Render *re)
|
||||||
{
|
{
|
||||||
bNode *node;
|
bNode *node;
|
||||||
@ -2210,7 +2195,8 @@ static void tag_scenes_for_render(Render *re)
|
|||||||
for(sce= re->main->scene.first; sce; sce= sce->id.next)
|
for(sce= re->main->scene.first; sce; sce= sce->id.next)
|
||||||
sce->id.flag &= ~LIB_DOIT;
|
sce->id.flag &= ~LIB_DOIT;
|
||||||
|
|
||||||
re->scene->id.flag |= LIB_DOIT;
|
if(RE_GetCamera(re) && composite_needs_render(re->scene, 1))
|
||||||
|
re->scene->id.flag |= LIB_DOIT;
|
||||||
|
|
||||||
if(re->scene->nodetree==NULL) return;
|
if(re->scene->nodetree==NULL) return;
|
||||||
|
|
||||||
@ -2257,24 +2243,6 @@ static void ntree_render_scenes(Render *re)
|
|||||||
set_scene_bg(re->main, re->scene);
|
set_scene_bg(re->main, re->scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* helper call to detect if theres a composite with render-result node */
|
|
||||||
static int composite_needs_render(Scene *sce)
|
|
||||||
{
|
|
||||||
bNodeTree *ntree= sce->nodetree;
|
|
||||||
bNode *node;
|
|
||||||
|
|
||||||
if(ntree==NULL) return 1;
|
|
||||||
if(sce->use_nodes==0) return 1;
|
|
||||||
if((sce->r.scemode & R_DOCOMP)==0) return 1;
|
|
||||||
|
|
||||||
for(node= ntree->nodes.first; node; node= node->next) {
|
|
||||||
if(node->type==CMP_NODE_R_LAYERS)
|
|
||||||
if(node->id==NULL || node->id==&sce->id)
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* bad call... need to think over proper method still */
|
/* bad call... need to think over proper method still */
|
||||||
static void render_composit_stats(void *UNUSED(arg), char *str)
|
static void render_composit_stats(void *UNUSED(arg), char *str)
|
||||||
{
|
{
|
||||||
@ -2290,6 +2258,16 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
|
|||||||
float *rectf, filt[3][3];
|
float *rectf, filt[3][3];
|
||||||
int sample;
|
int sample;
|
||||||
|
|
||||||
|
/* interaction callbacks */
|
||||||
|
if(ntree) {
|
||||||
|
ntree->stats_draw= render_composit_stats;
|
||||||
|
ntree->test_break= re->test_break;
|
||||||
|
ntree->progress= re->progress;
|
||||||
|
ntree->sdh= re->sdh;
|
||||||
|
ntree->tbh= re->tbh;
|
||||||
|
ntree->prh= re->prh;
|
||||||
|
}
|
||||||
|
|
||||||
/* filtmask needs it */
|
/* filtmask needs it */
|
||||||
R= *re;
|
R= *re;
|
||||||
|
|
||||||
@ -2297,25 +2275,27 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
|
|||||||
rectf= MEM_mapallocN(re->rectx*re->recty*sizeof(float)*4, "fullsample rgba");
|
rectf= MEM_mapallocN(re->rectx*re->recty*sizeof(float)*4, "fullsample rgba");
|
||||||
|
|
||||||
for(sample=0; sample<re->r.osa; sample++) {
|
for(sample=0; sample<re->r.osa; sample++) {
|
||||||
|
Render *re1;
|
||||||
RenderResult rres;
|
RenderResult rres;
|
||||||
int x, y, mask;
|
int x, y, mask;
|
||||||
|
|
||||||
/* set all involved renders on the samplebuffers (first was done by render itself) */
|
/* enable full sample print */
|
||||||
|
R.i.curfsa= sample+1;
|
||||||
|
|
||||||
|
/* set all involved renders on the samplebuffers (first was done by render itself, but needs tagged) */
|
||||||
/* also function below assumes this */
|
/* also function below assumes this */
|
||||||
if(sample) {
|
|
||||||
Render *re1;
|
|
||||||
|
|
||||||
tag_scenes_for_render(re);
|
tag_scenes_for_render(re);
|
||||||
for(re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
|
for(re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
|
||||||
if(re1->scene->id.flag & LIB_DOIT) {
|
if(re1->scene->id.flag & LIB_DOIT) {
|
||||||
if(re1->r.scemode & R_FULL_SAMPLE) {
|
if(re1->r.scemode & R_FULL_SAMPLE) {
|
||||||
|
if(sample)
|
||||||
read_render_result(re1, sample);
|
read_render_result(re1, sample);
|
||||||
ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */
|
ntreeCompositTagRender(re1->scene); /* ensure node gets exec to put buffers on stack */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* composite */
|
/* composite */
|
||||||
if(ntree) {
|
if(ntree) {
|
||||||
ntreeCompositTagRender(re->scene);
|
ntreeCompositTagRender(re->scene);
|
||||||
@ -2358,6 +2338,17 @@ static void do_merge_fullsample(Render *re, bNodeTree *ntree)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clear interaction callbacks */
|
||||||
|
if(ntree) {
|
||||||
|
ntree->stats_draw= NULL;
|
||||||
|
ntree->test_break= NULL;
|
||||||
|
ntree->progress= NULL;
|
||||||
|
ntree->tbh= ntree->sdh= ntree->prh= NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* disable full sample print */
|
||||||
|
R.i.curfsa= 0;
|
||||||
|
|
||||||
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||||
if(re->result->rectf)
|
if(re->result->rectf)
|
||||||
MEM_freeN(re->result->rectf);
|
MEM_freeN(re->result->rectf);
|
||||||
@ -2397,8 +2388,10 @@ void RE_MergeFullSample(Render *re, Main *bmain, Scene *sce, bNodeTree *ntree)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* own render result should be read/allocated */
|
/* own render result should be read/allocated */
|
||||||
if(re->scene->id.flag & LIB_DOIT)
|
if(re->scene->id.flag & LIB_DOIT) {
|
||||||
RE_ReadRenderResult(re->scene, re->scene);
|
RE_ReadRenderResult(re->scene, re->scene);
|
||||||
|
re->scene->id.flag &= ~LIB_DOIT;
|
||||||
|
}
|
||||||
|
|
||||||
/* and now we can draw (result is there) */
|
/* and now we can draw (result is there) */
|
||||||
re->display_init(re->dih, re->result);
|
re->display_init(re->dih, re->result);
|
||||||
@ -2416,12 +2409,21 @@ static void do_render_composite_fields_blur_3d(Render *re)
|
|||||||
/* INIT seeding, compositor can use random texture */
|
/* INIT seeding, compositor can use random texture */
|
||||||
BLI_srandom(re->r.cfra);
|
BLI_srandom(re->r.cfra);
|
||||||
|
|
||||||
if(composite_needs_render(re->scene)) {
|
if(composite_needs_render(re->scene, 1)) {
|
||||||
/* save memory... free all cached images */
|
/* save memory... free all cached images */
|
||||||
ntreeFreeCache(ntree);
|
ntreeFreeCache(ntree);
|
||||||
|
|
||||||
do_render_fields_blur_3d(re);
|
do_render_fields_blur_3d(re);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
|
/* ensure new result gets added, like for regular renders */
|
||||||
|
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||||
|
|
||||||
|
RE_FreeRenderResult(re->result);
|
||||||
|
re->result= new_render_result(re, &re->disprect, 0, RR_USEMEM);
|
||||||
|
|
||||||
|
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||||
|
|
||||||
/* scene render process already updates animsys */
|
/* scene render process already updates animsys */
|
||||||
update_newframe = 1;
|
update_newframe = 1;
|
||||||
}
|
}
|
||||||
@ -2757,7 +2759,7 @@ int RE_is_rendering_allowed(Scene *scene, Object *camera_override, void *erh, vo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(scene->r.scemode & R_FULL_SAMPLE) {
|
if(scene->r.scemode & R_FULL_SAMPLE) {
|
||||||
if(composite_needs_render(scene)==0) {
|
if(composite_needs_render(scene, 0)==0) {
|
||||||
error(erh, "Full Sample AA not supported without 3d rendering");
|
error(erh, "Full Sample AA not supported without 3d rendering");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -502,21 +502,6 @@ int shadeHaloFloat(HaloRen *har, float *col, int zz,
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void fillBackgroundImage(float *collector, float fx, float fy)
|
|
||||||
{
|
|
||||||
collector[0] = 0.0;
|
|
||||||
collector[1] = 0.0;
|
|
||||||
collector[2] = 0.0;
|
|
||||||
collector[3] = 0.0;
|
|
||||||
|
|
||||||
if(R.backbuf) {
|
|
||||||
float dx= 1.0f/(float)R.winx;
|
|
||||||
float dy= 1.0f/(float)R.winy;
|
|
||||||
|
|
||||||
image_sample(R.backbuf, fx*dx, fy*dy, dx, dy, collector);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Only view vector is important here. Result goes to colf[3] */
|
/* Only view vector is important here. Result goes to colf[3] */
|
||||||
void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short thread)
|
void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short thread)
|
||||||
{
|
{
|
||||||
@ -626,18 +611,14 @@ void shadeSkyPixel(float *collector, float fx, float fy, short thread)
|
|||||||
|
|
||||||
float fac;
|
float fac;
|
||||||
|
|
||||||
/* 1. Do a backbuffer image: */
|
if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
|
||||||
if(R.r.bufflag & 1) {
|
/* 1. solid color */
|
||||||
fillBackgroundImage(collector, fx, fy);
|
|
||||||
}
|
|
||||||
else if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
|
|
||||||
/* 2. solid color */
|
|
||||||
VECCOPY(collector, &R.wrld.horr);
|
VECCOPY(collector, &R.wrld.horr);
|
||||||
|
|
||||||
collector[3] = 0.0f;
|
collector[3] = 0.0f;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* 3. */
|
/* 2. */
|
||||||
|
|
||||||
/* This one true because of the context of this routine */
|
/* This one true because of the context of this routine */
|
||||||
if(R.wrld.skytype & WO_SKYPAPER) {
|
if(R.wrld.skytype & WO_SKYPAPER) {
|
||||||
|
@ -183,6 +183,12 @@ endif()
|
|||||||
message(STATUS "Player Skipping: (${REM_MSG})")
|
message(STATUS "Player Skipping: (${REM_MSG})")
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
|
target_link_libraries(blenderplayer ${BLENDER_SORTED_LIBS})
|
||||||
|
|
||||||
|
unset(SEARCHLIB)
|
||||||
|
unset(SORTLIB)
|
||||||
|
unset(REMLIB)
|
||||||
|
unset(REM_MSG)
|
||||||
|
|
||||||
# else()
|
# else()
|
||||||
# target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
|
# target_link_libraries(blenderplayer ${BLENDER_LINK_LIBS})
|
||||||
# endif()
|
# endif()
|
||||||
|
@ -853,6 +853,12 @@ endif()
|
|||||||
message(STATUS "Blender Skipping: (${REM_MSG})")
|
message(STATUS "Blender Skipping: (${REM_MSG})")
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
|
target_link_libraries(blender ${BLENDER_SORTED_LIBS})
|
||||||
|
|
||||||
|
unset(SEARCHLIB)
|
||||||
|
unset(SORTLIB)
|
||||||
|
unset(REMLIB)
|
||||||
|
unset(REM_MSG)
|
||||||
|
|
||||||
#else()
|
#else()
|
||||||
# target_link_libraries(blender ${BLENDER_LINK_LIBS})
|
# target_link_libraries(blender ${BLENDER_LINK_LIBS})
|
||||||
#endif()
|
#endif()
|
||||||
|
@ -226,18 +226,43 @@ struct CcdConstructionInfo
|
|||||||
|
|
||||||
|
|
||||||
CcdConstructionInfo()
|
CcdConstructionInfo()
|
||||||
: m_localInertiaTensor(1.f, 1.f, 1.f),
|
:m_localInertiaTensor(1.f, 1.f, 1.f),
|
||||||
m_gravity(0,0,0),
|
m_gravity(0,0,0),
|
||||||
m_scaling(1.f,1.f,1.f),
|
m_scaling(1.f,1.f,1.f),
|
||||||
m_mass(0.f),
|
m_mass(0.f),
|
||||||
m_clamp_vel_min(-1.f),
|
m_clamp_vel_min(-1.f),
|
||||||
m_clamp_vel_max(-1.f),
|
m_clamp_vel_max(-1.f),
|
||||||
m_restitution(0.1f),
|
m_restitution(0.1f),
|
||||||
m_friction(0.5f),
|
m_friction(0.5f),
|
||||||
m_linearDamping(0.1f),
|
m_linearDamping(0.1f),
|
||||||
m_angularDamping(0.1f),
|
m_angularDamping(0.1f),
|
||||||
m_margin(0.06f),
|
m_margin(0.06f),
|
||||||
m_gamesoftFlag(0),
|
m_gamesoftFlag(0),
|
||||||
|
m_soft_linStiff(1.f),
|
||||||
|
m_soft_angStiff(1.f),
|
||||||
|
m_soft_volume(1.f),
|
||||||
|
m_soft_viterations(0),
|
||||||
|
m_soft_piterations(1),
|
||||||
|
m_soft_diterations(0),
|
||||||
|
m_soft_citerations(4),
|
||||||
|
m_soft_kSRHR_CL(0.1f),
|
||||||
|
m_soft_kSKHR_CL(1.f),
|
||||||
|
m_soft_kSSHR_CL(0.5f),
|
||||||
|
m_soft_kSR_SPLT_CL(0.5f),
|
||||||
|
m_soft_kSK_SPLT_CL(0.5f),
|
||||||
|
m_soft_kSS_SPLT_CL(0.5f),
|
||||||
|
m_soft_kVCF(1.f),
|
||||||
|
m_soft_kDP(0.f),
|
||||||
|
m_soft_kDG(0.f),
|
||||||
|
m_soft_kLF(0.f),
|
||||||
|
m_soft_kPR(0.f),
|
||||||
|
m_soft_kVC(0.f),
|
||||||
|
m_soft_kDF(0.2f),
|
||||||
|
m_soft_kMT(0),
|
||||||
|
m_soft_kCHR(1.0f),
|
||||||
|
m_soft_kKHR(0.1f),
|
||||||
|
m_soft_kSHR(1.0f),
|
||||||
|
m_soft_kAHR(0.7f),
|
||||||
m_collisionFlags(0),
|
m_collisionFlags(0),
|
||||||
m_bRigid(false),
|
m_bRigid(false),
|
||||||
m_bSoft(false),
|
m_bSoft(false),
|
||||||
@ -252,38 +277,13 @@ struct CcdConstructionInfo
|
|||||||
m_inertiaFactor(1.f),
|
m_inertiaFactor(1.f),
|
||||||
m_do_anisotropic(false),
|
m_do_anisotropic(false),
|
||||||
m_anisotropicFriction(1.f,1.f,1.f),
|
m_anisotropicFriction(1.f,1.f,1.f),
|
||||||
m_contactProcessingThreshold(1e10f),
|
|
||||||
m_soft_linStiff(1.f),
|
|
||||||
m_soft_angStiff(1.f),
|
|
||||||
m_soft_volume(1.f),
|
|
||||||
m_soft_viterations(0),
|
|
||||||
m_soft_piterations(1),
|
|
||||||
m_soft_diterations(0),
|
|
||||||
m_soft_citerations(4),
|
|
||||||
m_do_fh(false),
|
m_do_fh(false),
|
||||||
m_do_rot_fh(false),
|
m_do_rot_fh(false),
|
||||||
m_fh_spring(0.f),
|
m_fh_spring(0.f),
|
||||||
m_fh_damping(0.f),
|
m_fh_damping(0.f),
|
||||||
m_fh_distance(1.f),
|
m_fh_distance(1.f),
|
||||||
m_fh_normal(false),
|
m_fh_normal(false),
|
||||||
m_soft_kVCF(1.f),
|
m_contactProcessingThreshold(1e10f)
|
||||||
m_soft_kDG(0.f),
|
|
||||||
m_soft_kLF(0.f),
|
|
||||||
m_soft_kDP(0.f),
|
|
||||||
m_soft_kPR(0.f),
|
|
||||||
m_soft_kVC(0.f),
|
|
||||||
m_soft_kDF(0.2f),
|
|
||||||
m_soft_kMT(0),
|
|
||||||
m_soft_kCHR(1.0f),
|
|
||||||
m_soft_kKHR(0.1f),
|
|
||||||
m_soft_kSHR(1.0f),
|
|
||||||
m_soft_kAHR(0.7f),
|
|
||||||
m_soft_kSRHR_CL(0.1f),
|
|
||||||
m_soft_kSKHR_CL(1.f),
|
|
||||||
m_soft_kSSHR_CL(0.5f),
|
|
||||||
m_soft_kSR_SPLT_CL(0.5f),
|
|
||||||
m_soft_kSK_SPLT_CL(0.5f),
|
|
||||||
m_soft_kSS_SPLT_CL(0.5f)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user