Merging r42800 through r42895 from trunk into soc-2011-tomato

This commit is contained in:
2011-12-27 10:11:07 +00:00
193 changed files with 5938 additions and 3760 deletions

View File

@@ -281,10 +281,12 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
endif()
if(WITH_CODEC_QUICKTIME AND MINGW)
message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
"because it is currently unsupported, remove this "
"line if youre a developer who wants to add support.")
if(MINGW)
if(WITH_CODEC_QUICKTIME)
message(FATAL_ERROR "MINGW requires WITH_CODEC_QUICKTIME to be OFF "
"because it is currently unsupported, remove this "
"line if youre a developer who wants to add support.")
endif()
endif()
if(NOT WITH_FFTW3 AND WITH_MOD_OCEANSIM)
@@ -658,7 +660,7 @@ elseif(WIN32)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
set(OPENAL_LIBRARY wrap_oal)
set(OPENAL_LIBRARY OpenAL32)
set(OPENAL_LIBPATH ${OPENAL}/lib)
endif()

View File

@@ -756,7 +756,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')

View File

@@ -13,7 +13,7 @@ WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'OpenAL32 wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'

View File

@@ -14,7 +14,7 @@ BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PY
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = True

View File

@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_ICONV = True

View File

@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIB = 'OpenAL32'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_SNDFILE = True

View File

@@ -159,7 +159,8 @@ def validate_arguments(args, bc):
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES' 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE',
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH'
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
'WITH_BF_LIBMV'
]
# Have options here that scons expects to be lists

View File

@@ -1480,3 +1480,640 @@ Added
* :class:`bpy.types.SceneGameData.restrict_animation_updates`
* :class:`bpy.types.SceneGameData.show_obstacle_simulation`
2.60 to 2.61
============
bpy.types.BlendDataGroups
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataGroups.is_updated`
bpy.types.BlendDataBrushes
--------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataBrushes.is_updated`
bpy.types.Theme
---------------
Added
^^^^^
* :class:`bpy.types.Theme.clip_editor`
bpy.types.BlendData
-------------------
Added
^^^^^
* :class:`bpy.types.BlendData.movieclips`
bpy.types.BlendDataGreasePencils
--------------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataGreasePencils.is_updated`
bpy.types.BlendDataImages
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataImages.is_updated`
bpy.types.CompositorNodes
-------------------------
Added
^^^^^
* :class:`bpy.types.CompositorNodes.clear`
bpy.types.BlendDataScenes
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataScenes.is_updated`
bpy.types.RenderEngine
----------------------
Added
^^^^^
* :class:`bpy.types.RenderEngine.bl_use_shading_nodes`
* :class:`bpy.types.RenderEngine.is_animation`
* :class:`bpy.types.RenderEngine.is_preview`
* :class:`bpy.types.RenderEngine.tag_redraw`
* :class:`bpy.types.RenderEngine.tag_update`
* :class:`bpy.types.RenderEngine.update`
* :class:`bpy.types.RenderEngine.update_progress`
* :class:`bpy.types.RenderEngine.view_draw`
* :class:`bpy.types.RenderEngine.view_update`
bpy.types.BackgroundImage
-------------------------
Added
^^^^^
* :class:`bpy.types.BackgroundImage.clip`
* :class:`bpy.types.BackgroundImage.clip_user`
* :class:`bpy.types.BackgroundImage.show_background_image`
* :class:`bpy.types.BackgroundImage.source`
* :class:`bpy.types.BackgroundImage.use_camera_clip`
bpy.types.BlendDataMetaBalls
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataMetaBalls.is_updated`
bpy.types.SpaceTimeline
-----------------------
Added
^^^^^
* :class:`bpy.types.SpaceTimeline.cache_dynamicpaint`
bpy.types.BlendDataMeshes
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataMeshes.is_updated`
bpy.types.BlendDataNodeTrees
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataNodeTrees.is_updated`
bpy.types.RenderSettings
------------------------
Added
^^^^^
* :class:`bpy.types.RenderSettings.image_settings`
* :class:`bpy.types.RenderSettings.use_shading_nodes`
Removed
^^^^^^^
* **cineon_black**
* **cineon_gamma**
* **cineon_white**
* **color_mode**
* **exr_codec**
* **exr_preview**
* **exr_zbuf**
* **file_format**
* **file_quality**
* **jpeg2k_depth**
* **jpeg2k_preset**
* **jpeg2k_ycc**
* **use_cineon_log**
* **use_exr_half**
* **use_tiff_16bit**
bpy.types.Curve
---------------
Added
^^^^^
* :class:`bpy.types.Curve.cycles`
bpy.types.RegionView3D
----------------------
Added
^^^^^
* :class:`bpy.types.RegionView3D.view_camera_offset`
* :class:`bpy.types.RegionView3D.view_camera_zoom`
bpy.types.Scene
---------------
Added
^^^^^
* :class:`bpy.types.Scene.active_clip`
* :class:`bpy.types.Scene.cycles`
bpy.types.NodeLinks
-------------------
Added
^^^^^
* :class:`bpy.types.NodeLinks.clear`
bpy.types.BlendDataLattices
---------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataLattices.is_updated`
bpy.types.BlendDataParticles
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataParticles.is_updated`
bpy.types.BlendDataWorlds
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataWorlds.is_updated`
bpy.types.ObjectConstraints
---------------------------
Added
^^^^^
* :class:`bpy.types.ObjectConstraints.clear`
bpy.types.RenderLayers
----------------------
Added
^^^^^
* :class:`bpy.types.RenderLayers.new`
* :class:`bpy.types.RenderLayers.remove`
bpy.types.Menu
--------------
Added
^^^^^
* :class:`bpy.types.Menu.bl_description`
bpy.types.Lamp
--------------
Added
^^^^^
* :class:`bpy.types.Lamp.cycles`
* :class:`bpy.types.Lamp.node_tree`
* :class:`bpy.types.Lamp.use_nodes`
bpy.types.CurveSplines
----------------------
Added
^^^^^
* :class:`bpy.types.CurveSplines.clear`
bpy.types.Screen
----------------
Added
^^^^^
* :class:`bpy.types.Screen.use_play_clip_editors`
bpy.types.BlendDataActions
--------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataActions.is_updated`
bpy.types.BlendDataSounds
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataSounds.is_updated`
bpy.types.Object
----------------
Added
^^^^^
* :class:`bpy.types.Object.cycles_visibility`
* :class:`bpy.types.Object.slow_parent_offset`
Removed
^^^^^^^
* **time_offset**
* **use_time_offset_add_parent**
* **use_time_offset_edit**
* **use_time_offset_parent**
* **use_time_offset_particle**
bpy.types.ObjectModifiers
-------------------------
Added
^^^^^
* :class:`bpy.types.ObjectModifiers.clear`
bpy.types.BlendDataMaterials
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataMaterials.is_updated`
bpy.types.MetaBallElements
--------------------------
Added
^^^^^
* :class:`bpy.types.MetaBallElements.clear`
bpy.types.NodeSocket
--------------------
Added
^^^^^
* :class:`bpy.types.NodeSocket.group_socket`
* :class:`bpy.types.NodeSocket.show_expanded`
bpy.types.Node
--------------
Added
^^^^^
* :class:`bpy.types.Node.show_texture`
bpy.types.CompositorNodeOutputFile
----------------------------------
Added
^^^^^
* :class:`bpy.types.CompositorNodeOutputFile.image_settings`
Removed
^^^^^^^
* **exr_codec**
* **image_type**
* **quality**
* **use_exr_half**
bpy.types.BlendDataTexts
------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataTexts.is_updated`
bpy.types.ThemeView3D
---------------------
Added
^^^^^
* :class:`bpy.types.ThemeView3D.bundle_solid`
* :class:`bpy.types.ThemeView3D.camera_path`
bpy.types.Event
---------------
Added
^^^^^
* :class:`bpy.types.Event.unicode`
bpy.types.VertexGroups
----------------------
Added
^^^^^
* :class:`bpy.types.VertexGroups.clear`
bpy.types.TexMapping
--------------------
Added
^^^^^
* :class:`bpy.types.TexMapping.mapping`
* :class:`bpy.types.TexMapping.mapping_x`
* :class:`bpy.types.TexMapping.mapping_y`
* :class:`bpy.types.TexMapping.mapping_z`
bpy.types.BlendDataObjects
--------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataObjects.is_updated`
bpy.types.BlendDataCurves
-------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataCurves.is_updated`
bpy.types.BlendDataLibraries
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataLibraries.is_updated`
bpy.types.ThemeUserInterface
----------------------------
Added
^^^^^
* :class:`bpy.types.ThemeUserInterface.icon_alpha`
* :class:`bpy.types.ThemeUserInterface.panel`
bpy.types.SpaceNodeEditor
-------------------------
Added
^^^^^
* :class:`bpy.types.SpaceNodeEditor.shader_type`
bpy.types.SpaceView3D
---------------------
Added
^^^^^
* :class:`bpy.types.SpaceView3D.show_bundle_names`
* :class:`bpy.types.SpaceView3D.show_camera_path`
* :class:`bpy.types.SpaceView3D.show_reconstruction`
* :class:`bpy.types.SpaceView3D.tracks_draw_size`
* :class:`bpy.types.SpaceView3D.tracks_draw_type`
bpy.types.BlendDataWindowManagers
---------------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataWindowManagers.is_updated`
bpy.types.BlendDataScreens
--------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataScreens.is_updated`
bpy.types.BlendDataArmatures
----------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataArmatures.is_updated`
bpy.types.UserPreferencesInput
------------------------------
Added
^^^^^
* :class:`bpy.types.UserPreferencesInput.tweak_threshold`
Removed
^^^^^^^
* **ndof_orbit_invert_axes**
bpy.types.Mesh
--------------
Added
^^^^^
* :class:`bpy.types.Mesh.cycles`
bpy.types.BlendDataCameras
--------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataCameras.is_updated`
bpy.types.MetaBall
------------------
Added
^^^^^
* :class:`bpy.types.MetaBall.cycles`
bpy.types.UILayout
------------------
Added
^^^^^
* :class:`bpy.types.UILayout.template_image_settings`
* :class:`bpy.types.UILayout.template_marker`
* :class:`bpy.types.UILayout.template_movieclip`
* :class:`bpy.types.UILayout.template_node_link`
* :class:`bpy.types.UILayout.template_node_view`
* :class:`bpy.types.UILayout.template_texture_user`
* :class:`bpy.types.UILayout.template_track`
Function Arguments
^^^^^^^^^^^^^^^^^^
* :class:`bpy.types.UILayout.template_list` (data, property, active_data, active_property, prop_list, rows, maxrows, type), *was (data, property, active_data, active_property, rows, maxrows, type)*
bpy.types.ID
------------
Added
^^^^^
* :class:`bpy.types.ID.is_updated`
* :class:`bpy.types.ID.is_updated_data`
bpy.types.World
---------------
Added
^^^^^
* :class:`bpy.types.World.cycles`
* :class:`bpy.types.World.node_tree`
* :class:`bpy.types.World.use_nodes`
bpy.types.BlendDataTextures
---------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataTextures.is_updated`
bpy.types.ShaderNodes
---------------------
Added
^^^^^
* :class:`bpy.types.ShaderNodes.clear`
bpy.types.TimelineMarkers
-------------------------
Added
^^^^^
* :class:`bpy.types.TimelineMarkers.clear`
bpy.types.SpaceFileBrowser
--------------------------
Added
^^^^^
* :class:`bpy.types.SpaceFileBrowser.active_operator`
bpy.types.Material
------------------
Added
^^^^^
* :class:`bpy.types.Material.cycles`
bpy.types.BlendDataSpeakers
---------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataSpeakers.is_updated`
bpy.types.Camera
----------------
Added
^^^^^
* :class:`bpy.types.Camera.angle_x`
* :class:`bpy.types.Camera.angle_y`
* :class:`bpy.types.Camera.cycles`
* :class:`bpy.types.Camera.sensor_fit`
* :class:`bpy.types.Camera.sensor_height`
* :class:`bpy.types.Camera.sensor_width`
* :class:`bpy.types.Camera.show_sensor`
bpy.types.BlendDataLamps
------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataLamps.is_updated`
bpy.types.TextureNodes
----------------------
Added
^^^^^
* :class:`bpy.types.TextureNodes.clear`
bpy.types.BlendDataFonts
------------------------
Added
^^^^^
* :class:`bpy.types.BlendDataFonts.is_updated`

View File

@@ -121,7 +121,9 @@ void AUD_SoftwareDevice::AUD_SoftwareHandle::update()
if(flags & AUD_RENDER_DISTANCE)
{
if(m_device->m_distance_model == AUD_DISTANCE_MODEL_INVERSE_CLAMPED || m_device->m_distance_model == AUD_DISTANCE_MODEL_LINEAR_CLAMPED || m_device->m_distance_model == AUD_DISTANCE_MODEL_EXPONENT_CLAMPED)
if(m_device->m_distance_model == AUD_DISTANCE_MODEL_INVERSE_CLAMPED ||
m_device->m_distance_model == AUD_DISTANCE_MODEL_LINEAR_CLAMPED ||
m_device->m_distance_model == AUD_DISTANCE_MODEL_EXPONENT_CLAMPED)
{
distance = AUD_MAX(AUD_MIN(m_distance_max, distance), m_distance_reference);
}

View File

@@ -82,9 +82,9 @@ static void session_print_status()
session_print(status);
}
static BufferParams session_buffer_params()
static BufferParams& session_buffer_params()
{
BufferParams buffer_params;
static BufferParams buffer_params;
buffer_params.width = options.width;
buffer_params.height = options.height;
buffer_params.full_width = options.width;
@@ -109,12 +109,15 @@ static void session_init()
options.scene = NULL;
}
static void scene_init()
static void scene_init(int width, int height)
{
options.scene = new Scene(options.scene_params);
xml_read_file(options.scene, options.filepath.c_str());
options.width = options.scene->camera->width;
options.height = options.scene->camera->height;
if (width == 0 || height == 0) {
options.width = options.scene->camera->width;
options.height = options.scene->camera->height;
}
}
static void session_exit()
@@ -194,8 +197,8 @@ static int files_parse(int argc, const char *argv[])
static void options_parse(int argc, const char **argv)
{
options.width= 1024;
options.height= 512;
options.width= 0;
options.height= 0;
options.filepath = "";
options.session = NULL;
options.quiet = false;
@@ -234,6 +237,8 @@ static void options_parse(int argc, const char **argv)
"--samples %d", &options.session_params.samples, "Number of samples to render",
"--output %s", &options.session_params.output_path, "File path to write output image",
"--threads %d", &options.session_params.threads, "CPU Rendering Threads",
"--width %d", &options.width, "Window width in pixel",
"--height %d", &options.height, "Window height in pixel",
"--help", &help, "Print help message",
NULL);
@@ -287,7 +292,7 @@ static void options_parse(int argc, const char **argv)
}
/* load scene */
scene_init();
scene_init(options.width, options.height);
}
CCL_NAMESPACE_END

View File

@@ -257,8 +257,18 @@ static void xml_read_integrator(const XMLReadState& state, pugi::xml_node node)
xml_read_int(&integrator->min_bounce, node, "min_bounce");
xml_read_int(&integrator->max_bounce, node, "max_bounce");
xml_read_int(&integrator->max_diffuse_bounce, node, "max_diffuse_bounce");
xml_read_int(&integrator->max_glossy_bounce, node, "max_glossy_bounce");
xml_read_int(&integrator->max_transmission_bounce, node, "max_transmission_bounce");
xml_read_int(&integrator->transparent_min_bounce, node, "transparent_min_bounce");
xml_read_int(&integrator->transparent_max_bounce, node, "transparent_max_bounce");
xml_read_bool(&integrator->transparent_shadows, node, "transparent_shadows");
xml_read_bool(&integrator->no_caustics, node, "no_caustics");
xml_read_float(&integrator->blur_caustics, node, "blur_caustics");
xml_read_int(&integrator->seed, node, "seed");
}
/* Camera */

View File

@@ -0,0 +1,143 @@
#
# Copyright 2011, Blender Foundation.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# XML exporter for generating test files, not intended for end users
import os
import xml.etree.ElementTree as etree
import xml.dom.minidom as dom
import bpy
from bpy_extras.io_utils import ExportHelper
from bpy.props import PointerProperty, StringProperty
def strip(root):
root.text = None
root.tail = None
for elem in root:
strip(elem)
def write(node, fname):
strip(node)
s = etree.tostring(node)
s = dom.parseString(s).toprettyxml()
f = open(fname, "w")
f.write(s)
class CyclesXMLSettings(bpy.types.PropertyGroup):
@classmethod
def register(cls):
bpy.types.Scene.cycles_xml = PointerProperty(
type=cls,
name="Cycles XML export Settings",
description="Cycles XML export settings")
cls.filepath = StringProperty(
name='Filepath',
description='Filepath for the .xml file',
maxlen=256,
default='',
subtype='FILE_PATH')
@classmethod
def unregister(cls):
del bpy.types.Scene.cycles_xml
# User Interface Drawing Code
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@classmethod
def poll(self, context):
rd = context.scene.render
return rd.engine == 'CYCLES'
class PHYSICS_PT_fluid_export(RenderButtonsPanel, bpy.types.Panel):
bl_label = "Cycles XML Exporter"
def draw(self, context):
layout = self.layout
cycles = context.scene.cycles_xml
#layout.prop(cycles, "filepath")
layout.operator("export_mesh.cycles_xml")
# Export Operator
class ExportCyclesXML(bpy.types.Operator, ExportHelper):
bl_idname = "export_mesh.cycles_xml"
bl_label = "Export Cycles XML"
filename_ext = ".xml"
@classmethod
def poll(cls, context):
return context.active_object != None
def execute(self, context):
filepath = bpy.path.ensure_ext(self.filepath, ".xml")
# get mesh
scene = context.scene
object = context.active_object
if not object:
raise Exception("No active object")
mesh = object.to_mesh(scene, True, 'PREVIEW')
if not mesh:
raise Exception("No mesh data in active object")
# generate mesh node
nverts = ""
verts = ""
P = ""
for v in mesh.vertices:
P += "%f %f %f " % (v.co[0], v.co[1], v.co[2])
for i, f in enumerate(mesh.faces):
nverts += str(len(f.vertices)) + " "
for v in f.vertices:
verts += str(v) + " "
verts += " "
node = etree.Element('mesh', attrib={'nverts': nverts, 'verts': verts, 'P': P})
# write to file
write(node, filepath)
return {'FINISHED'}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()

View File

@@ -22,17 +22,17 @@ import bpy
def init():
import bcycles
import _cycles
import os.path
path = os.path.dirname(__file__)
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', '')))
bcycles.init(path, user_path)
_cycles.init(path, user_path)
def create(engine, data, scene, region=0, v3d=0, rv3d=0):
import bcycles
import _cycles
data = data.as_pointer()
scene = scene.as_pointer()
@@ -43,42 +43,42 @@ def create(engine, data, scene, region=0, v3d=0, rv3d=0):
if rv3d:
rv3d = rv3d.as_pointer()
engine.session = bcycles.create(engine.as_pointer(), data, scene, region, v3d, rv3d)
engine.session = _cycles.create(engine.as_pointer(), data, scene, region, v3d, rv3d)
def free(engine):
if hasattr(engine, "session"):
if engine.session:
import bcycles
bcycles.free(engine.session)
import _cycles
_cycles.free(engine.session)
del engine.session
def render(engine):
import bcycles
import _cycles
if hasattr(engine, "session"):
bcycles.render(engine.session)
_cycles.render(engine.session)
def update(engine, data, scene):
import bcycles
bcycles.sync(engine.session)
import _cycles
_cycles.sync(engine.session)
def draw(engine, region, v3d, rv3d):
import bcycles
import _cycles
v3d = v3d.as_pointer()
rv3d = rv3d.as_pointer()
# draw render image
bcycles.draw(engine.session, v3d, rv3d)
_cycles.draw(engine.session, v3d, rv3d)
def available_devices():
import bcycles
return bcycles.available_devices()
import _cycles
return _cycles.available_devices()
def with_osl():
import bcycles
return bcycles.with_osl()
import _cycles
return _cycles.with_osl

View File

@@ -160,18 +160,17 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
scene = context.scene
rd = scene.render
# row = layout.row()
# row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
row = layout.row()
row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
# col = row.column(align=True)
# col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
# col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
col = row.column(align=True)
col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
row = layout.row()
# rl = rd.layers.active
rl = rd.layers[0]
rl = rd.layers.active
row.prop(rl, "name")
#row.prop(rd, "use_single_layer", text="", icon_only=True)
row.prop(rd, "use_single_layer", text="", icon_only=True)
split = layout.split()
@@ -183,6 +182,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
layout.separator()
rl = rd.layers[0]
layout.prop(rl, "material_override", text="Material")
@@ -745,6 +745,12 @@ def get_panels():
bpy.types.RENDER_PT_encoding,
bpy.types.RENDER_PT_dimensions,
bpy.types.RENDER_PT_stamp,
bpy.types.SCENE_PT_scene,
bpy.types.SCENE_PT_audio,
bpy.types.SCENE_PT_unit,
bpy.types.SCENE_PT_keying_sets,
bpy.types.SCENE_PT_keying_set_paths,
bpy.types.SCENE_PT_physics,
bpy.types.WORLD_PT_context_world,
bpy.types.DATA_PT_context_mesh,
bpy.types.DATA_PT_context_camera,

View File

@@ -232,8 +232,10 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated)
BL::Object::material_slots_iterator slot;
for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) {
if(render_layer.material_override)
find_shader(render_layer.material_override, used_shaders, scene->default_surface);
BL::Material material_override = render_layers.front().material_override;
if(material_override)
find_shader(material_override, used_shaders, scene->default_surface);
else
find_shader(slot->material(), used_shaders, scene->default_surface);
}

View File

@@ -154,7 +154,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int b_index, BL::Object b_ob,
/* Object */
void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint visibility)
void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm, uint layer_flag)
{
/* light is handled separately */
if(object_is_light(b_ob)) {
@@ -181,11 +181,19 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
if(object_updated || (object->mesh && object->mesh->need_update)) {
object->name = b_ob.name().c_str();
object->tfm = tfm;
object->visibility = object_ray_visibility(b_ob) & visibility;
/* visibility flags for both parent */
object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL;
if(b_parent.ptr.data != b_ob.ptr.data)
object->visibility &= object_ray_visibility(b_parent);
/* camera flag is not actually used, instead is tested
against render layer flags */
if(object->visibility & PATH_RAY_CAMERA) {
object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
object->visibility &= ~PATH_RAY_CAMERA;
}
object->tag_update(scene);
}
}
@@ -195,8 +203,7 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob,
void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
{
/* layer data */
uint scene_layer = render_layer.scene_layer;
uint layer = render_layer.layer;
uint scene_layer = render_layers.front().scene_layer;
/* prepare for sync */
light_map.pre_sync();
@@ -212,11 +219,6 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
uint ob_layer = get_layer(b_ob->layers());
if(!hide && (ob_layer & scene_layer)) {
uint visibility = PATH_RAY_ALL;
if(!(ob_layer & layer))
visibility &= ~PATH_RAY_CAMERA;
if(b_ob->is_duplicator()) {
/* dupli objects */
object_create_duplilist(*b_ob, b_scene);
@@ -226,7 +228,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
for(b_ob->dupli_list.begin(b_dup); b_dup != b_ob->dupli_list.end(); ++b_dup) {
Transform tfm = get_transform(b_dup->matrix());
sync_object(*b_ob, b_index, b_dup->object(), tfm, visibility);
sync_object(*b_ob, b_index, b_dup->object(), tfm, ob_layer);
b_index++;
}
@@ -244,7 +246,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d)
if(!hide) {
/* object itself */
Transform tfm = get_transform(b_ob->matrix_world());
sync_object(*b_ob, 0, *b_ob, tfm, visibility);
sync_object(*b_ob, 0, *b_ob, tfm, ob_layer);
}
}
}

View File

@@ -35,8 +35,7 @@ static PyObject *init_func(PyObject *self, PyObject *args)
path_init(path, user_path);
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
static PyObject *create_func(PyObject *self, PyObject *args)
@@ -89,35 +88,23 @@ static PyObject *create_func(PyObject *self, PyObject *args)
return PyLong_FromVoidPtr(session);
}
static PyObject *free_func(PyObject *self, PyObject *args)
static PyObject *free_func(PyObject *self, PyObject *value)
{
PyObject *pysession;
delete (BlenderSession*)PyLong_AsVoidPtr(value);
if(!PyArg_ParseTuple(args, "O", &pysession))
return NULL;
delete (BlenderSession*)PyLong_AsVoidPtr(pysession);
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
static PyObject *render_func(PyObject *self, PyObject *args)
static PyObject *render_func(PyObject *self, PyObject *value)
{
PyObject *pysession;
if(!PyArg_ParseTuple(args, "O", &pysession))
return NULL;
Py_BEGIN_ALLOW_THREADS
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
session->render();
Py_END_ALLOW_THREADS
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
static PyObject *draw_func(PyObject *self, PyObject *args)
@@ -137,22 +124,15 @@ static PyObject *draw_func(PyObject *self, PyObject *args)
session->draw(viewport[2], viewport[3]);
}
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
static PyObject *sync_func(PyObject *self, PyObject *args)
static PyObject *sync_func(PyObject *self, PyObject *value)
{
PyObject *pysession;
if(!PyArg_ParseTuple(args, "O", &pysession))
return NULL;
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
session->synchronize();
Py_INCREF(Py_None);
return Py_None;
Py_RETURN_NONE;
}
static PyObject *available_devices_func(PyObject *self, PyObject *args)
@@ -163,38 +143,26 @@ static PyObject *available_devices_func(PyObject *self, PyObject *args)
for(size_t i = 0; i < types.size(); i++) {
string name = Device::string_from_type(types[i]);
PyTuple_SetItem(ret, i, PyUnicode_FromString(name.c_str()));
PyTuple_SET_ITEM(ret, i, PyUnicode_FromString(name.c_str()));
}
return ret;
}
static PyObject *with_osl_func(PyObject *self, PyObject *args)
{
#ifdef WITH_OSL
PyObject *ret = Py_True;
#else
PyObject *ret = Py_False;
#endif
return Py_INCREF(ret), ret;
}
static PyMethodDef methods[] = {
{"init", init_func, METH_VARARGS, ""},
{"create", create_func, METH_VARARGS, ""},
{"free", free_func, METH_VARARGS, ""},
{"render", render_func, METH_VARARGS, ""},
{"free", free_func, METH_O, ""},
{"render", render_func, METH_O, ""},
{"draw", draw_func, METH_VARARGS, ""},
{"sync", sync_func, METH_VARARGS, ""},
{"sync", sync_func, METH_O, ""},
{"available_devices", available_devices_func, METH_NOARGS, ""},
{"with_osl", with_osl_func, METH_NOARGS, ""},
{NULL, NULL, 0, NULL},
};
static struct PyModuleDef module = {
PyModuleDef_HEAD_INIT,
"bcycles",
"_cycles",
"Blender cycles render integration",
-1,
methods,
@@ -207,6 +175,16 @@ extern "C" PyObject *CYCLES_initPython();
PyObject *CYCLES_initPython()
{
return PyModule_Create(&ccl::module);
PyObject *mod= PyModule_Create(&ccl::module);
#ifdef WITH_OSL
PyModule_AddObject(mod, "with_osl", Py_True);
Py_INCREF(Py_True);
#else
PyModule_AddObject(mod, "with_osl", Py_False);
Py_INCREF(Py_False);
#endif
return mod;
}

View File

@@ -40,7 +40,8 @@
CCL_NAMESPACE_BEGIN
BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_, BL::Scene b_scene_)
: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL)
: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(PointerRNA_NULL), b_rv3d(PointerRNA_NULL),
b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
{
/* offline render */
BL::RenderSettings r = b_scene.render();
@@ -55,7 +56,8 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_
BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_, BL::Scene b_scene_,
BL::SpaceView3D b_v3d_, BL::RegionView3D b_rv3d_, int width_, int height_)
: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(b_v3d_), b_rv3d(b_rv3d_)
: b_engine(b_engine_), b_data(b_data_), b_scene(b_scene_), b_v3d(b_v3d_), b_rv3d(b_rv3d_),
b_rr(PointerRNA_NULL), b_rlay(PointerRNA_NULL)
{
/* 3d view render */
width = width_;
@@ -64,6 +66,7 @@ BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::BlendData b_data_
last_redraw_time = 0.0f;
create_session();
session->start();
}
BlenderSession::~BlenderSession()
@@ -99,11 +102,9 @@ void BlenderSession::create_session()
session->progress.set_cancel_callback(function_bind(&BlenderSession::test_cancel, this));
session->set_pause(BlenderSync::get_session_pause(b_scene, background));
/* start rendering */
/* set buffer parameters */
BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
session->reset(buffer_params, session_params.samples);
session->start();
}
void BlenderSession::free_session()
@@ -114,42 +115,67 @@ void BlenderSession::free_session()
void BlenderSession::render()
{
session->wait();
/* get buffer parameters */
BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
int w = buffer_params.width, h = buffer_params.height;
if(session->progress.get_cancel())
return;
/* create render result */
RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, 0, 0, w, h);
PointerRNA rrptr;
RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
b_rr = BL::RenderResult(rrptr);
/* write result */
write_render_result();
BL::RenderSettings r = b_scene.render();
BL::RenderResult::layers_iterator b_iter;
BL::RenderLayers b_rr_layers(r.ptr);
int active = 0;
/* render each layer */
for(b_rr.layers.begin(b_iter); b_iter != b_rr.layers.end(); ++b_iter, ++active) {
/* single layer render */
if(r.use_single_layer())
active = b_rr_layers.active_index();
/* set layer */
b_rlay = *b_iter;
/* update scene */
sync->sync_data(b_v3d, active);
/* render */
session->start();
session->wait();
if(session->progress.get_cancel())
break;
/* write result */
write_render_result();
}
/* delete render result */
RE_engine_end_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
}
void BlenderSession::write_render_result()
{
/* get result */
/* get state */
RenderBuffers *buffers = session->buffers;
float exposure = scene->film->exposure;
double total_time, sample_time;
int sample;
session->progress.get_sample(sample, total_time, sample_time);
/* get pixels */
float4 *pixels = buffers->copy_from_device(exposure, sample);
if(!pixels)
return;
BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height);
int w = buffer_params.width, h = buffer_params.height;
struct RenderResult *rrp = RE_engine_begin_result((RenderEngine*)b_engine.ptr.data, 0, 0, w, h);
PointerRNA rrptr;
RNA_pointer_create(NULL, &RNA_RenderResult, rrp, &rrptr);
BL::RenderResult rr(rrptr);
BL::RenderResult::layers_iterator layer;
rr.layers.begin(layer);
rna_RenderLayer_rect_set(&layer->ptr, (float*)pixels);
RE_engine_end_result((RenderEngine*)b_engine.ptr.data, rrp);
/* write pixels */
rna_RenderLayer_rect_set(&b_rlay.ptr, (float*)pixels);
RE_engine_update_result((RenderEngine*)b_engine.ptr.data, (RenderResult*)b_rr.ptr.data);
delete [] pixels;
}
@@ -164,6 +190,7 @@ void BlenderSession::synchronize()
scene->params.modified(scene_params)) {
free_session();
create_session();
session->start();
return;
}

View File

@@ -69,6 +69,8 @@ public:
BL::Scene b_scene;
BL::SpaceView3D b_v3d;
BL::RegionView3D b_rv3d;
BL::RenderResult b_rr;
BL::RenderLayer b_rlay;
string last_status;
float last_progress;

View File

@@ -48,7 +48,8 @@ BlenderSync::BlenderSync(BL::BlendData b_data_, BL::Scene b_scene_, Scene *scene
light_map(&scene_->lights),
world_map(NULL),
world_recalc(false),
experimental(false)
experimental(false),
active_layer(0)
{
scene = scene_;
preview = preview_;
@@ -120,18 +121,18 @@ bool BlenderSync::sync_recalc()
return recalc;
}
void BlenderSync::sync_data(BL::SpaceView3D b_v3d)
void BlenderSync::sync_data(BL::SpaceView3D b_v3d, int layer)
{
sync_integrator();
sync_render_layers(b_v3d);
sync_integrator(layer);
sync_film();
sync_render_layer(b_v3d);
sync_shaders();
sync_objects(b_v3d);
}
/* Integrator */
void BlenderSync::sync_integrator()
void BlenderSync::sync_integrator(int layer)
{
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
@@ -152,9 +153,8 @@ void BlenderSync::sync_integrator()
integrator->transparent_shadows = get_boolean(cscene, "use_transparent_shadows");
integrator->no_caustics = get_boolean(cscene, "no_caustics");
integrator->blur_caustics = get_float(cscene, "blur_caustics");
integrator->seed = get_int(cscene, "seed");
integrator->layer_flag = render_layers[layer].layer;
if(integrator->modified(previntegrator))
integrator->tag_update(scene);
@@ -186,27 +186,32 @@ void BlenderSync::sync_film()
/* Render Layer */
void BlenderSync::sync_render_layer(BL::SpaceView3D b_v3d)
void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d)
{
render_layers.clear();
if(b_v3d) {
render_layer.scene_layer = get_layer(b_v3d.layers());
render_layer.layer = render_layer.scene_layer;
render_layer.material_override = PointerRNA_NULL;
RenderLayerInfo rlay;
rlay.scene_layer = get_layer(b_v3d.layers());
rlay.layer = rlay.scene_layer;
rlay.material_override = PointerRNA_NULL;
render_layers.push_back(rlay);
}
else {
BL::RenderSettings r = b_scene.render();
BL::RenderSettings::layers_iterator b_rlay;
bool first = true;
for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
/* single layer for now */
if(first) {
render_layer.scene_layer = get_layer(b_scene.layers());
render_layer.layer = get_layer(b_rlay->layers());
render_layer.material_override = b_rlay->material_override();
RenderLayerInfo rlay;
first = false;
}
rlay.scene_layer = get_layer(b_scene.layers());
rlay.layer = get_layer(b_rlay->layers());
rlay.material_override = b_rlay->material_override();
render_layers.push_back(rlay);
}
}
}

View File

@@ -54,7 +54,7 @@ public:
/* sync */
bool sync_recalc();
void sync_data(BL::SpaceView3D b_v3d);
void sync_data(BL::SpaceView3D b_v3d, int layer = 0);
void sync_camera(int width, int height);
void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
@@ -70,15 +70,15 @@ private:
void sync_materials();
void sync_objects(BL::SpaceView3D b_v3d);
void sync_film();
void sync_integrator();
void sync_integrator(int layer);
void sync_view();
void sync_world();
void sync_render_layer(BL::SpaceView3D b_v3d);
void sync_render_layers(BL::SpaceView3D b_v3d);
void sync_shaders();
void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree);
Mesh *sync_mesh(BL::Object b_ob, bool object_updated);
void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint visibility);
void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag);
void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm);
/* util */
@@ -112,7 +112,10 @@ private:
uint scene_layer;
uint layer;
BL::Material material_override;
} render_layer;
};
vector<RenderLayerInfo> render_layers;
int active_layer;
};
CCL_NAMESPACE_END

View File

@@ -130,13 +130,16 @@ __device_inline void path_state_next(KernelGlobals *kg, PathState *state, int la
}
}
__device_inline uint path_state_ray_visibility(PathState *state)
__device_inline uint path_state_ray_visibility(KernelGlobals *kg, PathState *state)
{
uint flag = state->flag;
/* for visibility, diffuse/glossy are for reflection only */
if(flag & PATH_RAY_TRANSMIT)
flag &= ~(PATH_RAY_DIFFUSE|PATH_RAY_GLOSSY);
/* for camera visibility, use render layer flags */
if(flag & PATH_RAY_CAMERA)
flag |= kernel_data.integrator.layer_flag;
return flag;
}
@@ -249,7 +252,7 @@ __device float4 kernel_path_integrate(KernelGlobals *kg, RNG *rng, int sample, R
for(;; rng_offset += PRNG_BOUNCE_NUM) {
/* intersect scene */
Intersection isect;
uint visibility = path_state_ray_visibility(&state);
uint visibility = path_state_ray_visibility(kg, &state);
if(!scene_intersect(kg, &ray, visibility, &isect)) {
/* eval background shader if nothing hit */

View File

@@ -100,7 +100,10 @@ enum PathTraceDimension {
/* these flag values correspond exactly to OSL defaults, so be careful not to
* change this, or if you do, set the "raytypes" shading system attribute with
* your own new ray types and bitflag values */
* your own new ray types and bitflag values.
*
* for ray visibility tests in BVH traversal, the upper 20 bits are used for
* layer visibility tests. */
enum PathRayFlag {
PATH_RAY_CAMERA = 1,
@@ -117,7 +120,9 @@ enum PathRayFlag {
PATH_RAY_MIS_SKIP = 512,
PATH_RAY_ALL = (1|2|4|8|16|32|64|128|256|512)
PATH_RAY_ALL = (1|2|4|8|16|32|64|128|256|512),
PATH_RAY_LAYER_SHIFT = (32-20)
};
/* Closure Label */
@@ -383,10 +388,12 @@ typedef struct KernelIntegrator {
/* caustics */
int no_caustics;
float blur_caustics;
/* seed */
int seed;
/* render layer */
int layer_flag;
} KernelIntegrator;
typedef struct KernelBVH {

View File

@@ -41,9 +41,8 @@ Integrator::Integrator()
transparent_shadows = false;
no_caustics = false;
blur_caustics = 0.0f;
seed = 0;
layer_flag = ~0;
need_update = true;
}
@@ -81,9 +80,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene)
kintegrator->transparent_shadows = transparent_shadows;
kintegrator->no_caustics = no_caustics;
kintegrator->blur_caustics = blur_caustics;
kintegrator->seed = hash_int(seed);
kintegrator->layer_flag = layer_flag << PATH_RAY_LAYER_SHIFT;
/* sobol directions table */
int dimensions = PRNG_BASE_NUM + (max_bounce + transparent_max_bounce + 2)*PRNG_BOUNCE_NUM;
@@ -115,7 +113,7 @@ bool Integrator::modified(const Integrator& integrator)
transparent_probalistic == integrator.transparent_probalistic &&
transparent_shadows == integrator.transparent_shadows &&
no_caustics == integrator.no_caustics &&
blur_caustics == integrator.blur_caustics &&
layer_flag == integrator.layer_flag &&
seed == integrator.seed);
}

View File

@@ -41,9 +41,9 @@ public:
bool transparent_shadows;
bool no_caustics;
float blur_caustics;
int seed;
int layer_flag;
bool need_update;

View File

@@ -81,7 +81,8 @@ extern GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle);
* @param eventCallback The event callback routine.
* @param userdata Pointer to user data returned to the callback routine.
*/
extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata);
extern GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userdata);
/**
* Disposes an event consumer object

View File

@@ -181,7 +181,10 @@ public:
* @param userData Placeholder for user data.
* @return A timer task (0 if timer task installation failed).
*/
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0) = 0;
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay,
GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0) = 0;
/**
* Removes a timer.

View File

@@ -303,7 +303,7 @@ public:
* @param grab The new grab state of the cursor.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; };
virtual GHOST_TSuccess setCursorGrab(GHOST_TGrabCursorMode mode, GHOST_Rect *bounds) { return GHOST_kSuccess; }
#ifdef WITH_CXX_GUARDEDALLOC
public:

View File

@@ -65,7 +65,8 @@ GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
}
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr userdata)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userdata)
{
return (GHOST_EventConsumerHandle) new GHOST_CallbackEventConsumer (eventCallback, userdata);
}

View File

@@ -42,7 +42,7 @@
#include "GHOST_CallbackEventConsumer.h"
GHOST_CallbackEventConsumer::GHOST_CallbackEventConsumer(GHOST_EventCallbackProcPtr eventCallback,
GHOST_TUserDataPtr userData)
GHOST_TUserDataPtr userData)
{
m_eventCallback = eventCallback;
m_userData = userData;

View File

@@ -34,35 +34,42 @@
#define _GHOST_DEBUG_H_
#if defined(WIN32) && !defined(FREE_WINDOWS)
#ifdef DEBUG
#pragma warning (disable:4786) // suppress stl-MSVC debug info warning
// #define GHOST_DEBUG
#endif // DEBUG
# ifdef DEBUG
# pragma warning (disable:4786) // suppress stl-MSVC debug info warning
// #define GHOST_DEBUG
# endif // DEBUG
#endif // WIN32
#ifdef WITH_GHOST_DEBUG
#define GHOST_DEBUG // spit ghost events to stdout
# define GHOST_DEBUG // spit ghost events to stdout
#endif // WITH_GHOST_DEBUG
#ifdef GHOST_DEBUG
#include <iostream>
#include <stdio.h> //for printf()
# include <iostream>
# include <stdio.h> //for printf()
#endif // GHOST_DEBUG
#ifdef GHOST_DEBUG
#define GHOST_PRINT(x) { std::cout << x; }
#define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); }
# define GHOST_PRINT(x) { std::cout << x; }
# define GHOST_PRINTF(x, ...) { printf(x, __VA_ARGS__); }
#else // GHOST_DEBUG
#define GHOST_PRINT(x)
#define GHOST_PRINTF(x, ...)
# define GHOST_PRINT(x)
# define GHOST_PRINTF(x, ...)
#endif // GHOST_DEBUG
#ifdef GHOST_DEBUG
#define GHOST_ASSERT(x, info) { if (!(x)) {GHOST_PRINT("assertion failed: "); GHOST_PRINT(info); GHOST_PRINT("\n"); } }
# define GHOST_ASSERT(x, info) \
{ \
if (!(x)) { \
GHOST_PRINT("assertion failed: "); \
GHOST_PRINT(info); \
GHOST_PRINT("\n"); \
} \
}
#else // GHOST_DEBUG
#define GHOST_ASSERT(x, info)
# define GHOST_ASSERT(x, info)
#endif // GHOST_DEBUG
#endif // _GHOST_DEBUG_H_

View File

@@ -75,7 +75,8 @@ public:
* @param numSettings The number of settings of the display device with this index.
* @return Indication of success.
*/
virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display, GHOST_TInt32& numSettings) const;
virtual GHOST_TSuccess getNumDisplaySettings(GHOST_TUns8 display,
GHOST_TInt32& numSettings) const;
/**
* Returns the current setting for this display device.
@@ -84,7 +85,9 @@ public:
* @param setting The setting of the display device with this index.
* @return Indication of success.
*/
virtual GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display, GHOST_TInt32 index, GHOST_DisplaySetting& setting) const;
virtual GHOST_TSuccess getDisplaySetting(GHOST_TUns8 display,
GHOST_TInt32 index,
GHOST_DisplaySetting& setting) const;
/**
* Returns the current setting for this display device.
@@ -92,7 +95,8 @@ public:
* @param setting The current setting of the display device with this index.
* @return Indication of success.
*/
virtual GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display, GHOST_DisplaySetting& setting) const;
virtual GHOST_TSuccess getCurrentDisplaySetting(GHOST_TUns8 display,
GHOST_DisplaySetting& setting) const;
/**
* Changes the current setting for this display device.
@@ -102,7 +106,8 @@ public:
* @param setting The setting of the display device to be matched and activated.
* @return Indication of success.
*/
virtual GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display, const GHOST_DisplaySetting& setting);
virtual GHOST_TSuccess setCurrentDisplaySetting(GHOST_TUns8 display,
const GHOST_DisplaySetting& setting);
protected:
typedef std::vector<GHOST_DisplaySetting> GHOST_DisplaySettings;
@@ -114,7 +119,9 @@ protected:
* @param match The optimal display setting.
* @return Indication of success.
*/
GHOST_TSuccess findMatch(GHOST_TUns8 display, const GHOST_DisplaySetting& setting, GHOST_DisplaySetting& match) const;
GHOST_TSuccess findMatch(GHOST_TUns8 display,
const GHOST_DisplaySetting& setting,
GHOST_DisplaySetting& match) const;
/**
* Retrieves settings for each display device and stores them.

View File

@@ -44,19 +44,21 @@ extern "C" {
*
* The dragging sequence is performed in four phases:
*
* <li> Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started. Already gives the object data type,
* and the entering mouse location
* <li> Start sequence (GHOST_kEventDraggingEntered) that tells a drag'n'drop operation has started.
* Already gives the object data type, and the entering mouse location
*
* <li> Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation stops, to give the updated mouse position.
* Useful to highlight a potential destination, and update the status (through GHOST_setAcceptDragOperation) telling if the object can be dropped at
* <li> Update mouse position (GHOST_kEventDraggingUpdated) sent upon each mouse move until the drag'n'drop operation
* stops, to give the updated mouse position. Useful to highlight a potential destination, and update the status
* (through GHOST_setAcceptDragOperation) telling if the object can be dropped at
* the current cursor position.
*
* <li> Abort drag'n'drop sequence (GHOST_kEventDraggingExited) sent when the user moved the mouse outside the window.
*
* <li> Send the dropped data (GHOST_kEventDraggingDropDone)
*
* <li> Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon). This can happen when the user drops an object
* on the application icon. (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
* <li> Outside of the normal sequence, dropped data can be sent (GHOST_kEventDraggingDropOnIcon).
* This can happen when the user drops an object on the application icon.
* (Also used in OSX to pass the filename of the document the user doubled-clicked in the finder)
*
* <br><br>Note that the mouse positions are given in Blender coordinates (y=0 at bottom)
*
@@ -78,7 +80,10 @@ public:
* @param y The y-coordinate of the location the cursor was at at the time of the event.
* @param data The "content" dropped in the window
*/
GHOST_EventDragnDrop(GHOST_TUns64 time, GHOST_TEventType type, GHOST_TDragnDropTypes dataType, GHOST_IWindow* window,
GHOST_EventDragnDrop(GHOST_TUns64 time,
GHOST_TEventType type,
GHOST_TDragnDropTypes dataType,
GHOST_IWindow* window,
int x, int y, GHOST_TEventDataPtr data)
: GHOST_Event(time, type, window)
{

View File

@@ -49,7 +49,10 @@ public:
* @param type The type of key event.
* @param key The key code of the key.
*/
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key)
GHOST_EventKey(GHOST_TUns64 msec,
GHOST_TEventType type,
GHOST_IWindow* window,
GHOST_TKey key)
: GHOST_Event(msec, type, window)
{
m_keyEventData.key = key;
@@ -65,7 +68,12 @@ public:
* @param key The key code of the key.
* @param ascii The ascii code for the key event.
*/
GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6])
GHOST_EventKey(GHOST_TUns64 msec,
GHOST_TEventType type,
GHOST_IWindow* window,
GHOST_TKey key,
char ascii,
const char utf8_buf[6])
: GHOST_Event(msec, type, window)
{
m_keyEventData.key = key;

View File

@@ -19,7 +19,11 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file ghost/intern/GHOST_EventNDOF.h
* \ingroup GHOST
* Declaration of GHOST_EventManager class.
*/
#ifndef _GHOST_EVENT_NDOF_H_
#define _GHOST_EVENT_NDOF_H_

View File

@@ -50,7 +50,11 @@ public:
* @param x The x-delta of the pan event.
* @param y The y-delta of the pan event.
*/
GHOST_EventTrackpad(GHOST_TUns64 msec, GHOST_IWindow* window, GHOST_TTrackpadEventSubTypes subtype, GHOST_TInt32 x, GHOST_TInt32 y, GHOST_TInt32 deltaX, GHOST_TInt32 deltaY)
GHOST_EventTrackpad(GHOST_TUns64 msec,
GHOST_IWindow* window,
GHOST_TTrackpadEventSubTypes subtype,
GHOST_TInt32 x, GHOST_TInt32 y,
GHOST_TInt32 deltaX, GHOST_TInt32 deltaY)
: GHOST_Event(msec, GHOST_kEventTrackpad, window)
{
m_trackpadEventData.subtype = subtype;

View File

@@ -73,7 +73,10 @@ GHOST_TUns64 GHOST_System::getMilliSeconds() const
}
GHOST_ITimerTask* GHOST_System::installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData)
GHOST_ITimerTask* GHOST_System::installTimer(GHOST_TUns64 delay,
GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData)
{
GHOST_TUns64 millis = getMilliSeconds();
GHOST_TimerTask* timer = new GHOST_TimerTask(millis+delay, interval, timerProc, userData);

View File

@@ -97,7 +97,10 @@ public:
* @param userData Placeholder for user data.
* @return A timer task (0 if timer task installation failed).
*/
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0);
virtual GHOST_ITimerTask* installTimer(GHOST_TUns64 delay,
GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0);
/**
* Removes a timer.

View File

@@ -241,7 +241,9 @@ protected:
/**
* Handles a tablet event.
* @param eventPtr An NSEvent pointer (casted to void* to enable compilation in standard C++)
* @param eventType The type of the event. It needs to be passed separately as it can be either directly in the event type, or as a subtype if combined with a mouse button event
* @param eventType The type of the event.
* It needs to be passed separately as it can be either directly in the event type,
* or as a subtype if combined with a mouse button event.
* @return Indication whether the event was handled.
*/
GHOST_TSuccess handleTabletEvent(void *eventPtr, short eventType);

View File

@@ -790,9 +790,11 @@ GHOST_SystemX11::processEvent(XEvent *xe)
/*Check to see if the requestor is asking for String*/
if(xse->target == string || xse->target == compound_text || xse->target == c_string) {
if (xse->selection == XInternAtom(m_display, "PRIMARY", False)) {
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace, (unsigned char*)txt_select_buffer, strlen(txt_select_buffer));
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace,
(unsigned char*)txt_select_buffer, strlen(txt_select_buffer));
} else if (xse->selection == XInternAtom(m_display, "CLIPBOARD", False)) {
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace, (unsigned char*)txt_cut_buffer, strlen(txt_cut_buffer));
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 8, PropModeReplace,
(unsigned char*)txt_cut_buffer, strlen(txt_cut_buffer));
}
} else if (xse->target == target) {
Atom alist[4];
@@ -800,7 +802,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
alist[1] = string;
alist[2] = compound_text;
alist[3] = c_string;
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 32, PropModeReplace, (unsigned char*)alist, 4);
XChangeProperty(m_display, xse->requestor, xse->property, xse->target, 32, PropModeReplace,
(unsigned char*)alist, 4);
XFlush(m_display);
} else {
//Change property to None because we do not support anything but STRING

View File

@@ -51,8 +51,16 @@ public:
* @param timerProc The callbak invoked when the interval expires.
* @param data The timer user data.
*/
GHOST_TimerTask(GHOST_TUns64 start, GHOST_TUns64 interval, GHOST_TimerProcPtr timerProc, GHOST_TUserDataPtr userData = 0)
: m_start(start), m_interval(interval), m_next(start), m_timerProc(timerProc), m_userData(userData), m_auxData(0)
GHOST_TimerTask(GHOST_TUns64 start,
GHOST_TUns64 interval,
GHOST_TimerProcPtr timerProc,
GHOST_TUserDataPtr userData = 0)
: m_start(start),
m_interval(interval),
m_next(start),
m_timerProc(timerProc),
m_userData(userData),
m_auxData(0)
{
}

View File

@@ -145,15 +145,15 @@ GHOST_TSuccess GHOST_Window::setCursorShape(GHOST_TStandardCursor cursorShape)
}
GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2],
int hotX, int hotY)
int hotX, int hotY)
{
return setCustomCursorShape( (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask,
16, 16, hotX, hotY, 0, 1 );
return setCustomCursorShape((GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask,
16, 16, hotX, hotY, 0, 1 );
}
GHOST_TSuccess GHOST_Window::setCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
int sizex, int sizey, int hotX, int hotY,
int fg_color, int bg_color )
int sizex, int sizey, int hotX, int hotY,
int fg_color, int bg_color)
{
if (setWindowCustomCursorShape(bitmap, mask, sizex, sizey,hotX, hotY, fg_color, bg_color)) {
m_cursorShape = GHOST_kStandardCursorCustom;

View File

@@ -289,8 +289,9 @@ protected:
* Sets the cursor shape on the window using
* native window system calls.
*/
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2],
int hotX, int hotY) = 0;
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2],
int hotX, int hotY) = 0;
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 *bitmap, GHOST_TUns8 *mask,
int szx, int szy, int hotX, int hotY, int fg, int bg) = 0;

View File

@@ -1196,10 +1196,11 @@ static GHOST_TUns16 uns16ReverseBits(GHOST_TUns16 shrt)
return shrt;
}
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2], int hotX, int hotY)
GHOST_TUns8 mask[16][2],
int hotX, int hotY)
{
return setWindowCustomCursorShape((GHOST_TUns8*)bitmap, (GHOST_TUns8*)mask,
16, 16, hotX, hotY, 0, 1);
16, 16, hotX, hotY, 0, 1);
}
GHOST_TSuccess GHOST_WindowWin32::setWindowCustomCursorShape(GHOST_TUns8 *bitmap,

View File

@@ -309,7 +309,9 @@ protected:
* Sets the cursor shape on the window using
* native window system calls.
*/
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2], GHOST_TUns8 mask[16][2], int hotX, int hotY);
virtual GHOST_TSuccess setWindowCustomCursorShape(GHOST_TUns8 bitmap[16][2],
GHOST_TUns8 mask[16][2],
int hotX, int hotY);
virtual GHOST_TSuccess setWindowCustomCursorShape(
GHOST_TUns8 *bitmap,

View File

@@ -239,7 +239,8 @@ GHOST_WindowX11(
}
} else {
if (m_numOfAASamples && (m_numOfAASamples > samples)) {
printf("%s:%d: oversampling requested %i but using %i samples\n", __FILE__, __LINE__, m_numOfAASamples, samples);
printf("%s:%d: oversampling requested %i but using %i samples\n",
__FILE__, __LINE__, m_numOfAASamples, samples);
}
break;
}
@@ -1343,7 +1344,9 @@ installDrawingContext(
if (!s_firstContext) {
s_firstContext = m_context;
}
glXMakeCurrent(m_display, m_window,m_context);
glXMakeCurrent(m_display, m_window,m_context);
glClearColor(0.447, 0.447, 0.447, 0);
glClear(GL_COLOR_BUFFER_BIT);
success = GHOST_kSuccess;
} else {
success = GHOST_kFailure;
@@ -1491,7 +1494,8 @@ setWindowCursorGrab(
}
#ifdef GHOST_X11_GRAB
XGrabPointer(m_display, m_window, False, ButtonPressMask| ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
XGrabPointer(m_display, m_window, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
#endif
}
else {

View File

@@ -93,6 +93,14 @@ typedef unsigned long uintptr_t;
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>
/* XXX */
#ifndef uint64_t
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
#endif
#elif defined (__APPLE__)
#include <inttypes.h>

View File

@@ -225,11 +225,12 @@ void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness)
void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3])
{
IK_QSegment *qseg = (IK_QSegment*)seg;
const MT_Matrix3x3& change = qseg->BasisChange();
if (qseg->Translational() && qseg->Composite())
qseg = qseg->Composite();
const MT_Matrix3x3& change = qseg->BasisChange();
// convert from moto row major to blender column major
basis_change[0][0] = (float)change[0][0];
basis_change[1][0] = (float)change[0][1];

View File

@@ -1350,7 +1350,6 @@ static tbool GenerateTSpaces(STSpace psTspace[], const STriInfo pTriInfos[], con
for(s=0; s<iUniqueSubGroups; s++)
free(pUniSubGroups[s].pTriMembers);
iUniqueTspaces += iUniqueSubGroups;
iUniqueSubGroups = 0;
}
// clean up

View File

@@ -1137,7 +1137,7 @@ static NLboolean __nlInvert_SUPERLU(__NLContext *context) {
/* SuperLU variables */
SuperMatrix B;
NLint info;
NLint info = 0;
for(j=0; j<context->nb_rhs; j++, b+=n, x+=n) {
/* Create superlu array for B */

View File

@@ -368,7 +368,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
int m, n, bnz, *b_colptr, i;
int delta, maxint, nofsub, *invp;
int *b_rowind, *dhead, *qsize, *llist, *marker;
double t, SuperLU_timer_();
/* double t, SuperLU_timer_(); */
/* make gcc happy */
b_rowind=NULL;
@@ -377,7 +377,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
m = A->nrow;
n = A->ncol;
t = SuperLU_timer_();
/* t = SuperLU_timer_(); */
switch ( ispec ) {
case 0: /* Natural ordering */
for (i = 0; i < n; ++i) perm_c[i] = i;
@@ -391,8 +391,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
#if ( PRNTlevel>=1 )
printf("Use minimum degree ordering on A'*A.\n");
#endif
t = SuperLU_timer_() - t;
/*printf("Form A'*A time = %8.3f\n", t);*/
/*t = SuperLU_timer_() - t;
printf("Form A'*A time = %8.3f\n", t);*/
break;
case 2: /* Minimum degree ordering on A'+A */
if ( m != n ) ABORT("Matrix is not square");
@@ -401,8 +401,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
#if ( PRNTlevel>=1 )
printf("Use minimum degree ordering on A'+A.\n");
#endif
t = SuperLU_timer_() - t;
/*printf("Form A'+A time = %8.3f\n", t);*/
/*t = SuperLU_timer_() - t;
printf("Form A'+A time = %8.3f\n", t);*/
break;
case 3: /* Approximate minimum degree column ordering. */
get_colamd(m, n, Astore->nnz, Astore->colptr, Astore->rowind,
@@ -417,7 +417,7 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
}
if ( bnz != 0 ) {
t = SuperLU_timer_();
/* t = SuperLU_timer_(); */
/* Initialize and allocate storage for GENMMD. */
delta = 1; /* DELTA is a parameter to allow the choice of nodes
@@ -452,8 +452,8 @@ get_perm_c(int ispec, SuperMatrix *A, int *perm_c)
SUPERLU_FREE(llist);
SUPERLU_FREE(marker);
t = SuperLU_timer_() - t;
/* printf("call GENMMD time = %8.3f\n", t);*/
/* t = SuperLU_timer_() - t;
printf("call GENMMD time = %8.3f\n", t);*/
} else { /* Empty adjacency structure */
for (i = 0; i < n; ++i) perm_c[i] = i;

View File

@@ -303,7 +303,6 @@ scolumn_bmod (
d_fsupc=0 if fsupc >= fpanelc. */
d_fsupc = fst_col - fsupc;
lptr = xlsub[fsupc] + d_fsupc;
luptr = xlusup[fst_col] + d_fsupc;
nsupr = xlsub[fsupc+1] - xlsub[fsupc]; /* Leading dimension */
nsupc = jcol - fst_col; /* Excluding jcol */

View File

@@ -9,9 +9,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
{
/* System generated locals */
int i__1, i__2;
/* Local variables */
static int info;
static float temp;
@@ -213,14 +210,12 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
}
} else {
if (*incx == 1) {
i__1 = *n;
for (j = 1; j <= *n; ++j) {
if (X(j) != 0.f) {
if (nounit) {
X(j) /= A(j,j);
}
temp = X(j);
i__2 = *n;
for (i = j + 1; i <= *n; ++i) {
X(i) -= temp * A(i,j);
/* L50: */
@@ -230,7 +225,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
}
} else {
jx = kx;
i__1 = *n;
for (j = 1; j <= *n; ++j) {
if (X(jx) != 0.f) {
if (nounit) {
@@ -238,7 +232,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
}
temp = X(jx);
ix = jx;
i__2 = *n;
for (i = j + 1; i <= *n; ++i) {
ix += *incx;
X(ix) -= temp * A(i,j);
@@ -256,10 +249,8 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
if (lsame_(uplo, "U")) {
if (*incx == 1) {
i__1 = *n;
for (j = 1; j <= *n; ++j) {
temp = X(j);
i__2 = j - 1;
for (i = 1; i <= j-1; ++i) {
temp -= A(i,j) * X(i);
/* L90: */
@@ -272,11 +263,9 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
}
} else {
jx = kx;
i__1 = *n;
for (j = 1; j <= *n; ++j) {
temp = X(jx);
ix = kx;
i__2 = j - 1;
for (i = 1; i <= j-1; ++i) {
temp -= A(i,j) * X(ix);
ix += *incx;
@@ -294,7 +283,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
if (*incx == 1) {
for (j = *n; j >= 1; --j) {
temp = X(j);
i__1 = j + 1;
for (i = *n; i >= j+1; --i) {
temp -= A(i,j) * X(i);
/* L130: */
@@ -311,7 +299,6 @@ int strsv_(char *, char *, char *, int *, float *, int *, float *, int *);
for (j = *n; j >= 1; --j) {
temp = X(jx);
ix = kx;
i__1 = j + 1;
for (i = *n; i >= j+1; --i) {
temp -= A(i,j) * X(ix);
ix -= *incx;

View File

@@ -370,8 +370,6 @@ void
sFillRHS(trans_t trans, int nrhs, float *x, int ldx,
SuperMatrix *A, SuperMatrix *B)
{
NCformat *Astore;
float *Aval;
DNformat *Bstore;
float *rhs;
float one = 1.0;
@@ -379,8 +377,6 @@ sFillRHS(trans_t trans, int nrhs, float *x, int ldx,
int ldc;
char transc[1];
Astore = A->Store;
Aval = (float *) Astore->nzval;
Bstore = B->Store;
rhs = Bstore->nzval;
ldc = Bstore->lda;

View File

@@ -24,7 +24,8 @@
#define NUM_TEMPV(m,w,t,b) ( SUPERLU_MAX(m, (t + b)*w) )
#ifndef USER_ABORT
#define USER_ABORT(msg) superlu_abort_and_exit(msg)
#define USER_ABORT(msg) \
{ fprintf(stderr, "%s", msg); exit (-1); }
#endif
#define ABORT(err_msg) \

View File

@@ -121,24 +121,24 @@ _axis_convert_matrix = (
((-1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, 1.0, 0.0)),
((-1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (0.0, 0.0, -1.0)),
((0.0, -1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, -1.0), (1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, 1.0), (-1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
((0.0, 0.0, -1.0), (-1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, -1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
((0.0, 0.0, 1.0), (-1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, -1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, 1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 0.0, -1.0), (-1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, 1.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, -1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, 1.0, 0.0), (-1.0, 0.0, 0.0)),
((0.0, 1.0, 0.0), (0.0, 0.0, -1.0), (-1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (0.0, 0.0, -1.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, 1.0), (0.0, -1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)),
((0.0, 1.0, 0.0), (0.0, 0.0, 1.0), (1.0, 0.0, 0.0)),
((0.0, -1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, 1.0)),
((0.0, 0.0, -1.0), (1.0, 0.0, 0.0), (0.0, -1.0, 0.0)),
((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0)),
((0.0, 1.0, 0.0), (1.0, 0.0, 0.0), (0.0, 0.0, -1.0)),
((1.0, 0.0, 0.0), (0.0, -1.0, 0.0), (0.0, 0.0, -1.0)),
((1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)),
((1.0, 0.0, 0.0), (0.0, 0.0, 1.0), (0.0, -1.0, 0.0)),
((1.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)),
)
# store args as a single int

View File

@@ -89,7 +89,6 @@ KM_HIERARCHY = [
('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu
('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
('Text', 'TEXT_EDITOR', 'WINDOW', []),
('Console', 'CONSOLE', 'WINDOW', []),
('Clip', 'CLIP_EDITOR', 'WINDOW', [

View File

@@ -42,6 +42,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
"""
from mathutils import Vector
viewinv = rv3d.view_matrix.inverted()
if rv3d.is_perspective:
persinv = rv3d.perspective_matrix.inverted()
@@ -50,13 +51,11 @@ def region_2d_to_vector_3d(region, rv3d, coord):
-0.5
))
w = ((out[0] * persinv[0][3]) +
(out[1] * persinv[1][3]) +
(out[2] * persinv[2][3]) + persinv[3][3])
w = out.dot(persinv[3].xyz) + persinv[3][3]
return ((persinv * out) / w) - rv3d.view_matrix.inverted()[3].xyz
return ((persinv * out) / w) - viewinv.translation
else:
return rv3d.view_matrix.inverted()[2].xyz.normalized()
return viewinv.col[2].xyz.normalized()
def region_2d_to_location_3d(region, rv3d, coord, depth_location):
@@ -81,15 +80,16 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
from mathutils.geometry import intersect_point_line
persmat = rv3d.perspective_matrix.copy()
viewinv = rv3d.view_matrix.inverted()
coord_vec = region_2d_to_vector_3d(region, rv3d, coord)
depth_location = Vector(depth_location)
if rv3d.is_perspective:
from mathutils.geometry import intersect_line_plane
origin_start = rv3d.view_matrix.inverted()[3].to_3d()
origin_start = viewinv.translation.copy()
origin_end = origin_start + coord_vec
view_vec = rv3d.view_matrix.inverted()[2]
view_vec = viewinv.col[2].copy()
return intersect_line_plane(origin_start,
origin_end,
depth_location,
@@ -100,8 +100,9 @@ def region_2d_to_location_3d(region, rv3d, coord, depth_location):
dy = (2.0 * coord[1] / region.height) - 1.0
persinv = persmat.inverted()
viewinv = rv3d.view_matrix.inverted()
origin_start = ((persinv[0].xyz * dx) +
(persinv[1].xyz * dy) + viewinv[3].xyz)
origin_start = ((persinv.col[0].xyz * dx) +
(persinv.col[1].xyz * dy) +
viewinv.translation)
origin_end = origin_start + coord_vec
return intersect_point_line(depth_location,
origin_start,

View File

@@ -188,7 +188,7 @@ class CLIP_OT_delete_proxy(Operator):
proxydir = clip.proxy.directory
else:
clipdir = os.path.dirname(clip.filepath)
proxydir = os.path.join(clipdir, 'BL_proxy')
proxydir = os.path.join(clipdir, "BL_proxy")
clipfile = os.path.basename(clip.filepath)
proxy = os.path.join(proxydir, clipfile)
@@ -196,15 +196,15 @@ class CLIP_OT_delete_proxy(Operator):
# proxy_<quality>[_undostorted]
for x in (25, 50, 75, 100):
d = os.path.join(absproxy, 'proxy_' + str(x))
d = os.path.join(absproxy, "proxy_%d" % x)
self._rmproxy(d)
self._rmproxy(d + '_undistorted')
self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi'))
self._rmproxy(d + "_undistorted")
self._rmproxy(os.path.join(absproxy, "proxy_%d.avi" % x))
tc = ('free_run.blen_tc',
'interp_free_run.blen_tc',
'record_run.blen_tc')
tc = ("free_run.blen_tc",
"interp_free_run.blen_tc",
"record_run.blen_tc")
for x in tc:
self._rmproxy(os.path.join(absproxy, x))
@@ -269,7 +269,7 @@ object's movement caused by this constraint"""
# TODO: several camera solvers and track followers would fail,
# but can't think about eal workflow where it'll be useful
for x in ob.constraints:
if x.type in ('CAMERA_SOLVER', 'FOLLOW_TRACK'):
if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK'}:
con = x
if not con:
@@ -340,7 +340,8 @@ object's movement caused by this constraint"""
def execute(self, context):
scene = context.scene
# XXX, should probably use context.selected_editable_objects
# since selected objects can be from a lib or in hidden layer!
for ob in scene.objects:
if ob.select:
self._bake_object(scene, ob)

View File

@@ -60,14 +60,14 @@ class SequencerCrossfadeSounds(Operator):
if seq1.frame_final_end > seq2.frame_final_start:
tempcfra = context.scene.frame_current
context.scene.frame_current = seq2.frame_final_start
seq1.keyframe_insert('volume')
seq1.keyframe_insert("volume")
context.scene.frame_current = seq1.frame_final_end
seq1.volume = 0
seq1.keyframe_insert('volume')
seq2.keyframe_insert('volume')
seq1.keyframe_insert("volume")
seq2.keyframe_insert("volume")
context.scene.frame_current = seq2.frame_final_start
seq2.volume = 0
seq2.keyframe_insert('volume')
seq2.keyframe_insert("volume")
context.scene.frame_current = tempcfra
return {'FINISHED'}
else:

View File

@@ -756,7 +756,7 @@ def VectoQuat(vec):
class thickface(object):
__slost__= 'v', 'uv', 'no', 'area', 'edge_keys'
__slost__= "v", "uv", "no", "area", "edge_keys"
def __init__(self, face, uvface, mesh_verts):
self.v = [mesh_verts[i] for i in face.vertices]
if len(self.v)==4:

View File

@@ -766,12 +766,12 @@ class WM_OT_path_open(Operator):
return {'CANCELLED'}
if sys.platform[:3] == "win":
subprocess.Popen(['start', filepath], shell=True)
elif sys.platform == 'darwin':
subprocess.Popen(['open', filepath])
subprocess.Popen(["start", filepath], shell=True)
elif sys.platform == "darwin":
subprocess.Popen(["open", filepath])
else:
try:
subprocess.Popen(['xdg-open', filepath])
subprocess.Popen(["xdg-open", filepath])
except OSError:
# xdg-open *should* be supported by recent Gnome, KDE, Xfce
pass
@@ -847,8 +847,8 @@ class WM_OT_doc_edit(Operator):
print("sending data:", data_dict)
import xmlrpc.client
user = 'blenderuser'
pwd = 'blender>user'
user = "blenderuser"
pwd = "blender>user"
docblog = xmlrpc.client.ServerProxy(self._url)
docblog.metaWeblog.newPost(1, user, pwd, data_dict, 1)
@@ -986,9 +986,8 @@ class WM_OT_properties_edit(Operator):
prop_ui = rna_idprop_ui_prop_get(item, prop)
if prop_type in {float, int}:
prop_ui['soft_min'] = prop_ui['min'] = prop_type(self.min)
prop_ui['soft_max'] = prop_ui['max'] = prop_type(self.max)
prop_ui["soft_min"] = prop_ui["min"] = prop_type(self.min)
prop_ui["soft_max"] = prop_ui["max"] = prop_type(self.max)
prop_ui['description'] = self.description
@@ -1035,7 +1034,7 @@ class WM_OT_properties_add(Operator):
item = eval("context.%s" % data_path)
def unique_name(names):
prop = 'prop'
prop = "prop"
prop_new = prop
i = 1
while prop_new in names:
@@ -1163,10 +1162,10 @@ class WM_OT_copy_prev_settings(Operator):
# in 2.57 and earlier windows installers, system scripts were copied
# into the configuration directory, don't want to copy those
system_script = os.path.join(path_dst, 'scripts/modules/bpy_types.py')
system_script = os.path.join(path_dst, "scripts/modules/bpy_types.py")
if os.path.isfile(system_script):
shutil.rmtree(os.path.join(path_dst, 'scripts'))
shutil.rmtree(os.path.join(path_dst, 'plugins'))
shutil.rmtree(os.path.join(path_dst, "scripts"))
shutil.rmtree(os.path.join(path_dst, "plugins"))
# don't loose users work if they open the splash later.
if bpy.data.is_saved is bpy.data.is_dirty is False:
@@ -1178,20 +1177,20 @@ class WM_OT_copy_prev_settings(Operator):
return {'CANCELLED'}
class WM_OT_blenderplayer_start(bpy.types.Operator):
'''Launches the Blenderplayer with the current blendfile'''
'''Launch the Blenderplayer with the current blendfile'''
bl_idname = "wm.blenderplayer_start"
bl_label = "Start"
blender_bin_path = bpy.app.binary_path
blender_bin_dir = os.path.dirname(blender_bin_path)
ext = os.path.splitext(blender_bin_path)[-1]
player_path = os.path.join(blender_bin_dir, 'blenderplayer' + ext)
player_path = os.path.join(blender_bin_dir, "blenderplayer" + ext)
def execute(self, context):
import sys
if sys.platform == 'darwin':
self.player_path = os.path.join(self.blender_bin_dir, '../../../blenderplayer.app/Contents/MacOS/blenderplayer')
if sys.platform == "darwin":
self.player_path = os.path.join(self.blender_bin_dir, "../../../blenderplayer.app/Contents/MacOS/blenderplayer")
filepath = bpy.app.tempdir + "game.blend"
bpy.ops.wm.save_as_mainfile(filepath=filepath, check_existing=False, copy=True)
@@ -1451,7 +1450,7 @@ class WM_OT_operator_cheat_sheet(Operator):
for op_submodule_name in dir(op_module):
op = getattr(op_module, op_submodule_name)
text = repr(op)
if text.split("\n")[-1].startswith('bpy.ops.'):
if text.split("\n")[-1].startswith("bpy.ops."):
op_strings.append(text)
tot += 1

View File

@@ -2247,6 +2247,8 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
col.prop(mesh, "show_extra_edge_length")
col.prop(mesh, "show_extra_face_angle")
col.prop(mesh, "show_extra_face_area")
if bpy.app.debug:
col.prop(mesh, "show_extra_indices")
class VIEW3D_PT_view3d_curvedisplay(Panel):

View File

@@ -33,6 +33,8 @@
#ifndef BLF_TRANSLATION_H
#define BLF_TRANSLATION_H
#define TEXT_DOMAIN_NAME "blender"
/* blf_translation.c */
#ifdef WITH_INTERNATIONAL
@@ -40,7 +42,8 @@ unsigned char *BLF_get_unifont(int *unifont_size);
void BLF_free_unifont(void);
#endif
const char* BLF_gettext(const char *msgid);
const char *BLF_gettext(const char *msgid);
const char *BLF_pgettext(const char *context, const char *message);
/* blf_lang.c */

View File

@@ -32,6 +32,8 @@
#include <stdlib.h>
#include <string.h>
#include "BKE_global.h"
#include "BLF_api.h"
#include "BLF_translation.h" /* own include */
@@ -58,7 +60,6 @@
#include "BLI_utildefines.h"
#include "BLI_path_util.h"
#define DOMAIN_NAME "blender"
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
#define FONT_SIZE_DEFAULT 12
@@ -82,11 +83,16 @@ static const char *locales[] = {
"catalan", "ca_AD",
"czech", "cs_CZ",
"ptb", "pt_BR",
#if defined (_WIN32) && !defined(FREE_WINDOWS)
"Chinese (Simplified)_China.1252", "zh_CN",
"Chinese (Traditional)_China.1252", "zh_TW",
#else
"chs", "zh_CN",
"cht", "zh_TW",
#endif
"russian", "ru_RU",
"croatian", "hr_HR",
"serbian", "sr",
"serbian", "sr_RS",
"ukrainian", "uk_UA",
"polish", "pl_PL",
"romanian", "ro_RO",
@@ -97,7 +103,7 @@ static const char *locales[] = {
"nepali", "ne_NP",
"persian", "fa_PE",
"indonesian", "id_ID",
"serbian (latin)", "sr@latin",
"serbian (latin)", "sr_RS@latin",
};
void BLF_lang_init(void)
@@ -116,15 +122,50 @@ void BLF_lang_init(void)
}
/* get LANG/LANGUAGE environment variable */
static void get_language_variable(const char *varname, char *var, int maxlen)
{
char *env= getenv(varname);
if(env) {
char *s;
/* store defaul locale */
BLI_strncpy(var, env, maxlen);
/* use first language as default */
s= strchr(var, ':');
if(s)
s[0]= 0;
}
}
/* get language to be used based on locale(which might be empty when using default language) and
* LANG environment variable
*/
static void get_language(const char *locale, const char *lang, char *language, int maxlen)
{
if(locale[0]) {
BLI_strncpy(language, locale, maxlen);
}
else {
char *s;
BLI_strncpy(language, lang, maxlen);
s= strchr(language, '.');
if(s)
s[0]= 0;
}
}
/* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
void BLF_lang_set(const char *str)
{
char *locreturn;
const char *short_locale;
int ok= 1;
#if defined (_WIN32) && !defined(FREE_WINDOWS)
const char *long_locale = locales[ 2 * U.language];
#endif
const char *long_locale = locales[2 * U.language];
if((U.transopts&USER_DOTRANSLATE)==0)
return;
@@ -150,50 +191,72 @@ void BLF_lang_set(const char *str)
locreturn= setlocale(LC_ALL, long_locale);
if (locreturn == NULL) {
printf("Could not change locale to %s\n", long_locale);
if(G.f & G_DEBUG)
printf("Could not change locale to %s\n", long_locale);
ok= 0;
}
#else
{
const char *locale;
static char default_locale[64]="\0";
static char default_lang[64]="\0";
static char default_language[64]="\0";
if(default_locale[0]==0) {
char *env_language= getenv("LANGUAGE");
if(default_lang[0]==0)
get_language_variable("LANG", default_lang, sizeof(default_lang));
if(env_language) {
char *s;
if(default_language[0]==0)
get_language_variable("LANGUAGE", default_language, sizeof(default_language));
/* store defaul locale */
BLI_strncpy(default_locale, env_language, sizeof(default_locale));
if(short_locale[0]) {
if(G.f & G_DEBUG)
printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
/* use first language as default */
s= strchr(default_locale, ':');
if(s) s[0]= 0;
}
BLI_setenv("LANG", short_locale);
BLI_setenv("LANGUAGE", short_locale);
}
else {
if(G.f & G_DEBUG)
printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
BLI_setenv("LANG", default_lang);
BLI_setenv("LANGUAGE", default_language);
}
if(short_locale[0])
locale= short_locale;
else
locale= default_locale;
locreturn= setlocale(LC_ALL, short_locale);
BLI_setenv("LANG", locale);
BLI_setenv("LANGUAGE", locale);
if(locreturn == NULL) {
char *short_locale_utf8= NULL;
locreturn= setlocale(LC_ALL, locale);
if (locreturn == NULL) {
char *short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
locreturn= setlocale(LC_ALL, short_locale_utf8);
if(short_locale[0]) {
short_locale_utf8= BLI_sprintfN("%s.UTF-8", short_locale);
locreturn= setlocale(LC_ALL, short_locale_utf8);
}
if (locreturn == NULL) {
printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
char language[65];
get_language(long_locale, default_lang, language, sizeof(language));
if(G.f & G_DEBUG) {
if(short_locale[0])
printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
else
printf("Could not reset locale\n");
printf("Fallback to LANG=%s and LANGUAGE=%s\n", default_lang, language);
}
/* fallback to default settings */
BLI_setenv("LANG", default_lang);
BLI_setenv("LANGUAGE", language);
locreturn= setlocale(LC_ALL, "");
ok= 0;
}
MEM_freeN(short_locale_utf8);
if(short_locale_utf8)
MEM_freeN(short_locale_utf8);
}
}
#endif
@@ -205,15 +268,15 @@ void BLF_lang_set(const char *str)
setlocale(LC_NUMERIC, "C");
textdomain(DOMAIN_NAME);
bindtextdomain(DOMAIN_NAME, global_messagepath);
bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name);
textdomain(TEXT_DOMAIN_NAME);
bindtextdomain(TEXT_DOMAIN_NAME, global_messagepath);
bind_textdomain_codeset(TEXT_DOMAIN_NAME, global_encoding_name);
}
void BLF_lang_encoding(const char *str)
{
BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
/* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
/* bind_textdomain_codeset(TEXT_DOMAIN_NAME, encoding_name); */
}
#else /* ! WITH_INTERNATIONAL */

View File

@@ -29,9 +29,19 @@
*/
#include <stdlib.h>
#include <string.h>
#ifdef WITH_INTERNATIONAL
#include <libintl.h>
#include <locale.h>
#define GETTEXT_CONTEXT_GLUE "\004"
/* needed for windows version of gettext */
#ifndef LC_MESSAGES
# define LC_MESSAGES 1729
#endif
#endif
#include "MEM_guardedalloc.h"
@@ -91,6 +101,41 @@ const char* BLF_gettext(const char *msgid)
#endif
}
const char *BLF_pgettext(const char *context, const char *message)
{
#ifdef WITH_INTERNATIONAL
char static_msg_ctxt_id[1024];
char *dynamic_msg_ctxt_id = NULL;
char *msg_ctxt_id;
const char *translation;
size_t overall_length = strlen(context) + strlen(message) + sizeof(GETTEXT_CONTEXT_GLUE) + 1;
if (overall_length > sizeof(static_msg_ctxt_id)) {
dynamic_msg_ctxt_id = malloc(overall_length);
msg_ctxt_id = dynamic_msg_ctxt_id;
}
else {
msg_ctxt_id = static_msg_ctxt_id;
}
sprintf(msg_ctxt_id, "%s%s%s", context, GETTEXT_CONTEXT_GLUE, message);
translation = (char*)dcgettext(TEXT_DOMAIN_NAME, msg_ctxt_id, LC_MESSAGES);
if (dynamic_msg_ctxt_id)
free(dynamic_msg_ctxt_id);
if (translation == msg_ctxt_id)
translation = message;
return translation;
#else
(void)context;
return message;
#endif
}
int BLF_translate_iface(void)
{
#ifdef WITH_INTERNATIONAL
@@ -132,4 +177,3 @@ const char *BLF_translate_do_tooltip(const char *msgid)
return msgid;
#endif
}

View File

@@ -38,10 +38,12 @@
extern "C" {
#endif
#include "../blenloader/BLO_sys_types.h" /* XXX, should have a more generic include for this */
struct ID;
struct CustomData;
struct CustomDataLayer;
typedef unsigned int CustomDataMask;
typedef uint64_t CustomDataMask;
extern const CustomDataMask CD_MASK_BAREMESH;
extern const CustomDataMask CD_MASK_MESH;
@@ -65,6 +67,8 @@ extern const CustomDataMask CD_MASK_FACECORNERS;
#define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source
has same number of elements */
#define CD_TYPE_AS_MASK(_type) (CustomDataMask)(1 << (CustomDataMask)(_type))
/* initialises a CustomData object with the same layer setup as source.
* mask is a bitfield where (mask & (1 << (layer type))) indicates
* if a layer should be copied or not. alloctype must be one of the above. */

View File

@@ -72,7 +72,7 @@ extern int append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rect
void filepath_ffmpeg(char* string, struct RenderData* rd);
extern void ffmpeg_set_preset(struct RenderData *rd, int preset);
extern void ffmpeg_verify_image_type(struct RenderData *rd);
extern void ffmpeg_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf);
extern struct IDProperty *ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index);
extern int ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str);

View File

@@ -69,7 +69,7 @@ typedef struct DagNode
int ancestor_count;
unsigned int lay; // accumulated layers of its relations + itself
unsigned int scelay; // layers due to being in scene
unsigned int customdata_mask; // customdata mask
uint64_t customdata_mask; // customdata mask
int lasttime; // if lasttime != DagForest->time, this node was not evaluated yet for flushing
int BFS_dist; // BFS distance
int DFS_dist; // DFS distance

View File

@@ -943,7 +943,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest,
number++;
if(lastflag & CD_FLAG_NOCOPY) continue;
else if(!((int)mask & (int)(1 << (int)type))) continue;
else if(!(mask & CD_TYPE_AS_MASK(type))) continue;
else if(number < CustomData_number_of_layers(dest, type)) continue;
if((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE))
@@ -1500,7 +1500,7 @@ void CustomData_set_only_copy(const struct CustomData *data,
int i;
for(i = 0; i < data->totlayer; ++i)
if(!((int)mask & (int)(1 << (int)data->layers[i].type)))
if(!(mask & CD_TYPE_AS_MASK(data->layers[i].type)))
data->layers[i].flag |= CD_FLAG_NOCOPY;
}
@@ -2441,7 +2441,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
if(!(mask & (1<<layer->type)));
if(!(mask & CD_TYPE_AS_MASK(layer->type)));
else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) {
if(typeInfo->free)
typeInfo->free(layer->data, totelem, typeInfo->size);
@@ -2467,7 +2467,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
if(!(mask & (1<<layer->type)));
if(!(mask & CD_TYPE_AS_MASK(layer->type)));
else if(layer->flag & CD_FLAG_IN_MEMORY);
else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read)
update= 1;
@@ -2488,7 +2488,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
if(!(mask & (1<<layer->type)));
if(!(mask & CD_TYPE_AS_MASK(layer->type)));
else if(layer->flag & CD_FLAG_IN_MEMORY);
else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) {
blay= cdf_layer_find(cdf, layer->type, layer->name);
@@ -2527,7 +2527,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in
layer = &data->layers[i];
typeInfo = layerType_getInfo(layer->type);
if(!(mask & (1<<layer->type)));
if(!(mask & CD_TYPE_AS_MASK(layer->type)));
else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write)
update= 1;
}
@@ -2641,7 +2641,7 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem)
if(layer->flag & CD_FLAG_EXTERNAL) {
if(!(layer->flag & CD_FLAG_IN_MEMORY))
CustomData_external_read(data, id, (1<<layer->type), totelem);
CustomData_external_read(data, id, CD_TYPE_AS_MASK(layer->type), totelem);
layer->flag &= ~CD_FLAG_EXTERNAL;

View File

@@ -1709,7 +1709,7 @@ static void scene_sort_groups(Main *bmain, Scene *sce)
/* sort the base list on dependency order */
void DAG_scene_sort(Main *bmain, Scene *sce)
{
DagNode *node;
DagNode *node, *rootnode;
DagNodeQueue *nqueue;
DagAdjList *itA;
int time;
@@ -1731,11 +1731,10 @@ void DAG_scene_sort(Main *bmain, Scene *sce)
time = 1;
node = sce->theDag->DagNode.first;
node->color = DAG_GRAY;
rootnode = sce->theDag->DagNode.first;
rootnode->color = DAG_GRAY;
time++;
push_stack(nqueue,node);
push_stack(nqueue,rootnode);
while(nqueue->count) {
@@ -2853,10 +2852,8 @@ void DAG_pose_sort(Object *ob)
for(node = dag->DagNode.first; node; node= node->next)
node->color = DAG_WHITE;
node = dag->DagNode.first;
node->color = DAG_GRAY;
push_stack(nqueue, node);
rootnode->color = DAG_GRAY;
push_stack(nqueue, rootnode);
while(nqueue->count) {

View File

@@ -1414,10 +1414,7 @@ void driver_free_variable (ChannelDriver *driver, DriverVar *dvar)
DRIVER_TARGETS_LOOPER_END
/* remove the variable from the driver */
if (driver)
BLI_freelinkN(&driver->variables, dvar);
else
MEM_freeN(dvar);
BLI_freelinkN(&driver->variables, dvar);
#ifdef WITH_PYTHON
/* since driver variables are cached, the expression needs re-compiling too */

View File

@@ -692,7 +692,11 @@ IDProperty *IDP_New(const int type, const IDPropertyTemplate *val, const char *n
case IDP_ARRAY:
{
/*for now, we only support float and int and double arrays*/
if (val->array.type == IDP_FLOAT || val->array.type == IDP_INT || val->array.type == IDP_DOUBLE || val->array.type == IDP_GROUP) {
if ( (val->array.type == IDP_FLOAT) ||
(val->array.type == IDP_INT) ||
(val->array.type == IDP_DOUBLE) ||
(val->array.type == IDP_GROUP) )
{
prop = MEM_callocN(sizeof(IDProperty), "IDProperty array");
prop->subtype = val->array.type;
if (val->array.len)

View File

@@ -1544,7 +1544,7 @@ int BKE_write_ibuf(ImBuf *ibuf, const char *name, ImageFormatData *imf)
ibuf->ftype= OPENEXR;
if(imf->depth == R_IMF_CHAN_DEPTH_16)
ibuf->ftype |= OPENEXR_HALF;
ibuf->ftype |= (quality & OPENEXR_COMPRESS);
ibuf->ftype |= (imf->exr_codec & OPENEXR_COMPRESS);
if(!(imf->flag & R_IMF_FLAG_ZBUF))
ibuf->zbuf_float = NULL; /* signal for exr saving */

View File

@@ -909,8 +909,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
if (array_index)
*array_index= dummy_index;
}
/* 'buf' _must_ be initialized in this block */
/* append preceding bits to path */
/* note, strings are not escapted and they should be! */
if ((actname && actname[0]) && (constname && constname[0])) {
/* Constraint in Pose-Channel */
sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
@@ -918,6 +920,7 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
else if (actname && actname[0]) {
if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) {
/* Actionified "Object" IPO's... no extra path stuff needed */
buf[0]= '\0'; /* empty string */
}
else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) {
/* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */
@@ -936,8 +939,10 @@ static char *get_rna_access (int blocktype, int adrcode, char actname[], char co
/* Sequence names in Scene */
sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
}
else
else {
buf[0]= '\0'; /* empty string */
}
BLI_dynstr_append(path, buf);
/* need to add dot before property if there was anything precceding this */

View File

@@ -466,8 +466,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if(mface->v3==0) {
static int corner_indices[4] = {1, 2, 0, 3};
SWAP(int, mface->v1, mface->v2);
SWAP(int, mface->v2, mface->v3);
SWAP(unsigned int, mface->v1, mface->v2);
SWAP(unsigned int, mface->v2, mface->v3);
if(fdata)
CustomData_swap(fdata, mfindex, corner_indices);
@@ -477,8 +477,8 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
if(mface->v3==0 || mface->v4==0) {
static int corner_indices[4] = {2, 3, 0, 1};
SWAP(int, mface->v1, mface->v3);
SWAP(int, mface->v2, mface->v4);
SWAP(unsigned int, mface->v1, mface->v3);
SWAP(unsigned int, mface->v2, mface->v4);
if(fdata)
CustomData_swap(fdata, mfindex, corner_indices);
@@ -520,12 +520,14 @@ void set_mesh(Object *ob, Mesh *me)
/* ************** make edges in a Mesh, for outside of editmode */
struct edgesort {
int v1, v2;
unsigned int v1, v2;
short is_loose, is_draw;
};
/* edges have to be added with lowest index first for sorting */
static void to_edgesort(struct edgesort *ed, int v1, int v2, short is_loose, short is_draw)
static void to_edgesort(struct edgesort *ed,
unsigned int v1, unsigned int v2,
short is_loose, short is_draw)
{
if(v1<v2) {
ed->v1= v1; ed->v2= v2;
@@ -627,7 +629,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, int UNUSED(
/* order is swapped so extruding this edge as a surface wont flip face normals
* with cyclic curves */
if(ed->v1+1 != ed->v2) {
SWAP(int, medge->v1, medge->v2);
SWAP(unsigned int, medge->v1, medge->v2);
}
medge++;
}
@@ -1029,17 +1031,17 @@ typedef struct EdgeLink {
typedef struct VertLink {
Link *next, *prev;
int index;
unsigned int index;
} VertLink;
static void prependPolyLineVert(ListBase *lb, int index)
static void prependPolyLineVert(ListBase *lb, unsigned int index)
{
VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
BLI_addhead(lb, vl);
}
static void appendPolyLineVert(ListBase *lb, int index)
static void appendPolyLineVert(ListBase *lb, unsigned int index)
{
VertLink *vl= MEM_callocN(sizeof(VertLink), "VertLink");
vl->index = index;
@@ -1111,8 +1113,8 @@ void mesh_to_curve(Scene *scene, Object *ob)
int closed = FALSE;
int totpoly= 0;
MEdge *med_current= ((EdgeLink *)edges.last)->edge;
int startVert= med_current->v1;
int endVert= med_current->v2;
unsigned int startVert= med_current->v1;
unsigned int endVert= med_current->v2;
int ok= TRUE;
appendPolyLineVert(&polyline, startVert); totpoly++;

View File

@@ -395,7 +395,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
while(i<data->totlayer) {
CustomDataLayer *layer= &data->layers[i];
int mask= 1 << layer->type;
CustomDataMask mask= CD_TYPE_AS_MASK(layer->type);
int ok= 1;
if((mask&CD_MASK_MESH)==0) {

View File

@@ -991,9 +991,9 @@ void unlink_movieclip(Main *bmain, MovieClip *clip)
}
for(ob= bmain->object.first; ob; ob= ob->id.next) {
bConstraint *con= ob->constraints.first;
bConstraint *con;
for (con= ob->constraints.first; con; con= con->next) {
for(con= ob->constraints.first; con; con= con->next) {
bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {

View File

@@ -2563,7 +2563,7 @@ void object_handle_update(Scene *scene, Object *ob)
#else /* ensure CD_MASK_BAREMESH for now */
EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL;
unsigned int data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH;
uint64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH;
if(em) {
makeDerivedMesh(scene, ob, em, data_mask); /* was CD_MASK_BAREMESH */
BKE_mesh_end_editmesh(ob->data, em);

View File

@@ -2292,6 +2292,9 @@ static int ccgdm_adjacent_grid(CCGSubSurf *ss, int *gridOffset, CCGFace *f, int
break;
}
}
if(numEdges == 0)
return -1;
fIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, adjf));

View File

@@ -299,7 +299,8 @@ static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *un
if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS))
continue;
if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */
/* scale down scalar so 1cm doesnt convert to 10mm because of float error */
if (value_abs >= unit->scalar*(1.0-EPS))
return unit;
}
@@ -481,11 +482,14 @@ static int ch_is_op(char op)
}
}
static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str)
static int unit_scale_str(char *str, int len_max, char *str_tmp,
double scale_pref, bUnitDef *unit, const char *replace_str)
{
char *str_found;
if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */
if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) {
/* XXX - investigate, does not respect len_max properly */
int len, len_num, len_name, len_move, found_ofs;
found_ofs = (int)(str_found-str);

View File

@@ -159,9 +159,6 @@ static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportL
avi = MEM_mallocN (sizeof(AviMovie), "avimovie");
/* RPW 11-21-2002
if (rd->imtype != AVI_FORMAT_MJPEG) format = AVI_FORMAT_AVI_RGB;
*/
if (rd->im_format.imtype != R_IMF_IMTYPE_AVIJPEG ) format = AVI_FORMAT_AVI_RGB;
else format = AVI_FORMAT_MJPEG;

View File

@@ -1333,11 +1333,11 @@ void ffmpeg_set_preset(RenderData *rd, int preset)
}
}
void ffmpeg_verify_image_type(RenderData *rd)
void ffmpeg_verify_image_type(RenderData *rd, ImageFormatData *imf)
{
int audio= 0;
if(rd->imtype == R_IMF_IMTYPE_FFMPEG) {
if(imf->imtype == R_IMF_IMTYPE_FFMPEG) {
if(rd->ffcodecdata.type <= 0 ||
rd->ffcodecdata.codec <= 0 ||
rd->ffcodecdata.audio_codec <= 0 ||
@@ -1353,19 +1353,19 @@ void ffmpeg_verify_image_type(RenderData *rd)
audio= 1;
}
else if(rd->imtype == R_IMF_IMTYPE_H264) {
else if(imf->imtype == R_IMF_IMTYPE_H264) {
if(rd->ffcodecdata.codec != CODEC_ID_H264) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_H264);
audio= 1;
}
}
else if(rd->imtype == R_IMF_IMTYPE_XVID) {
else if(imf->imtype == R_IMF_IMTYPE_XVID) {
if(rd->ffcodecdata.codec != CODEC_ID_MPEG4) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_XVID);
audio= 1;
}
}
else if(rd->imtype == R_IMF_IMTYPE_THEORA) {
else if(imf->imtype == R_IMF_IMTYPE_THEORA) {
if(rd->ffcodecdata.codec != CODEC_ID_THEORA) {
ffmpeg_set_preset(rd, FFMPEG_PRESET_THEORA);
audio= 1;

View File

@@ -317,7 +317,7 @@ void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char deli
void BLI_cleanup_path(const char *relabase, char *dir)
{
short a;
ptrdiff_t a;
char *start, *eind;
if (relabase) {
BLI_path_abs(dir, relabase);
@@ -1416,7 +1416,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
{
size_t path_len= strlen(path);
size_t ext_len= strlen(ext);
size_t a;
ssize_t a;
for(a= path_len - 1; a >= 0; a--) {
if (ELEM3(path[a], '.', '/', '\\')) {
@@ -1424,7 +1424,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext)
}
}
if (path[a] != '.') {
if ((a < 0) || (path[a] != '.')) {
a= path_len;
}
@@ -1440,7 +1440,7 @@ int BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
{
size_t path_len= strlen(path);
size_t ext_len= strlen(ext);
size_t a;
ssize_t a;
/* first check the extension is alread there */
if ( (ext_len <= path_len) &&

View File

@@ -54,7 +54,7 @@
#include <sys/mount.h>
#endif
#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux)
#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
#include <sys/vfs.h>
#endif
@@ -180,7 +180,7 @@ double BLI_dir_free_space(const char *dir)
if (slash) slash[1] = 0;
} else strcpy(name,"/");
#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__)
#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
if (statfs(name, &disk)) return(-1);
#endif

View File

@@ -86,6 +86,14 @@ typedef unsigned long uintptr_t;
/* Linux-i386, Linux-Alpha, Linux-ppc */
#include <stdint.h>
/* XXX */
#ifndef uint64_t
typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;
typedef uint64_t u_int64_t;
#endif
#elif defined (__APPLE__)
#include <inttypes.h>

View File

@@ -10712,8 +10712,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
void *olddata = ob->data;
ob->data = me;
if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) /* XXX - library meshes crash on loading most yoFrankie levels, the multires pointer gets invalid - Campbell */
/* XXX - library meshes crash on loading most yoFrankie levels,
* the multires pointer gets invalid - Campbell */
if(me && me->id.lib==NULL && me->mr && me->mr->level_count > 1) {
multires_load_old(ob, me);
}
ob->data = olddata;
}
@@ -14327,7 +14330,8 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
expand_main(fd, mainptr);
/* dang FileData... now new libraries need to be appended to original filedata, it is not a good replacement for the old global (ton) */
/* dang FileData... now new libraries need to be appended to original filedata,
* it is not a good replacement for the old global (ton) */
while( fd->mainlist.first ) {
Main *mp= fd->mainlist.first;
BLI_remlink(&fd->mainlist, mp);
@@ -14349,8 +14353,13 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
ID *idn= id->next;
if(id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id);
BKE_reportf(basefd->reports, RPT_ERROR, "LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
if(!G.background && basefd->reports)printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n", BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
BKE_reportf(basefd->reports, RPT_ERROR,
"LIB ERROR: %s:'%s' unread libblock missing from '%s'\n",
BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
if (!G.background && basefd->reports) {
printf("LIB ERROR: %s:'%s' unread libblock missing from '%s'\n",
BKE_idcode_to_name(GS(id->name)), id->name+2, mainptr->curlib->filepath);
}
change_idid_adr(mainlist, basefd, id, NULL);
MEM_freeN(id);

View File

@@ -496,7 +496,7 @@ void ANIM_flush_setting_anim_channels (bAnimContext *ac, ListBase *anim_data, bA
break;
/* store this level as the 'old' level now */
prevLevel= level; // XXX: prevLevel is unused
// prevLevel= level; // XXX: prevLevel is unused
}
}
}

View File

@@ -2205,12 +2205,12 @@ size_t ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_m
/* only filter data if there's somewhere to put it */
if (data && anim_data) {
Object *obact= (ac) ? ac->obact : NULL;
/* firstly filter the data */
switch (datatype) {
case ANIMCONT_ACTION: /* 'Action Editor' */
{
Object *obact= ac->obact;
SpaceAction *saction = (SpaceAction *)ac->sl;
bDopeSheet *ads = (saction)? &saction->ads : NULL;

View File

@@ -201,7 +201,7 @@ void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
/* Projection */
#define IS_CLIPPED 12000
void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
void ED_view3d_calc_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, const struct rcti *rect);
void project_short(struct ARegion *ar, const float vec[3], short adr[2]);
void project_short_noclip(struct ARegion *ar, const float vec[3], short adr[2]);
@@ -215,7 +215,7 @@ void project_float_noclip(struct ARegion *ar, const float vec[3], float adr[2]);
int ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
int ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *viewplane, float *clipsta, float *clipend);
void ED_view3d_ob_project_mat_get(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
void ED_view3d_project_float(struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
void ED_view3d_project_float(const struct ARegion *a, const float vec[3], float adr[2], float mat[4][4]);
void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, struct rctf *viewborder_r, short no_shift);
void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float size_r[2]);
@@ -257,7 +257,7 @@ void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
void view3d_operator_needs_opengl(const struct bContext *C);
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
int view3d_get_view_aligned_coordinate(struct ViewContext *vc, float fp[3], const int mval[2], const short do_fallback);
void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
void view3d_get_transformation(const struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
/* XXX should move to BLI_math */
int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
@@ -286,8 +286,8 @@ Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
int ED_view3d_lock(struct RegionView3D *rv3d);
unsigned int ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
unsigned int ED_viewedit_datamask(struct bScreen *screen);
uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
uint64_t ED_viewedit_datamask(struct bScreen *screen);
/* camera lock functions */
int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d);

View File

@@ -904,7 +904,9 @@ void uiEndBlock(const bContext *C, uiBlock *block)
/* handle pending stuff */
if(block->layouts.first) uiBlockLayoutResolve(block, NULL, NULL);
ui_block_do_align(block);
if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
if((block->flag & UI_BLOCK_LOOP) && (block->flag & UI_BLOCK_NUMSELECT)) {
ui_menu_block_set_keyaccels(block); /* could use a different flag to check */
}
if(block->flag & UI_BLOCK_LOOP) ui_menu_block_set_keymaps(C, block);
/* after keymaps! */

View File

@@ -681,7 +681,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v)
static int modifier_can_delete(ModifierData *md)
{
// fluid particle modifier can't be deleted here
/* fluid particle modifier can't be deleted here */
if(md->type == eModifierType_ParticleSystem)
if(((ParticleSystemModifierData *)md)->psys->part->type == PART_FLUID)
return 0;
@@ -689,14 +689,16 @@ static int modifier_can_delete(ModifierData *md)
return 1;
}
// Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab
/* Check wheter Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
static int modifier_is_simulation(ModifierData *md)
{
// Physic Tab
if(ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke, eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint)) {
/* Physic Tab */
if (ELEM7(md->type, eModifierType_Cloth, eModifierType_Collision, eModifierType_Fluidsim, eModifierType_Smoke,
eModifierType_Softbody, eModifierType_Surface, eModifierType_DynamicPaint))
{
return 1;
}
// Particle Tab
/* Particle Tab */
else if (md->type == eModifierType_ParticleSystem) {
return 2;
}
@@ -705,7 +707,8 @@ static int modifier_is_simulation(ModifierData *md)
}
}
static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, ModifierData *md, int index, int cageIndex, int lastCageIndex)
static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob,
ModifierData *md, int index, int cageIndex, int lastCageIndex)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
PointerRNA ptr;

View File

@@ -177,7 +177,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
/* 'standard view' - optimum setup for 'standard' view behaviour, that should be used new views as basis for their
/* 'standard view' - optimum setup for 'standard' view behaviour,
* that should be used new views as basis for their
* own unique View2D settings, which should be used instead of this in most cases...
*/
case V2D_COMMONVIEW_STANDARD:

View File

@@ -922,7 +922,10 @@ void make_editMesh(Scene *scene, Object *ob)
for(a=0; a<me->totselect; a++, mselect++){
/*check if recorded selection is still valid, if so copy into editmesh*/
if( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) || (mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) || (mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) ){
if ( (mselect->type == EDITVERT && me->mvert[mselect->index].flag & SELECT) ||
(mselect->type == EDITEDGE && me->medge[mselect->index].flag & SELECT) ||
(mselect->type == EDITFACE && me->mface[mselect->index].flag & ME_FACE_SEL) )
{
ese = MEM_callocN(sizeof(EditSelection), "Edit Selection");
ese->type = mselect->type;
if(ese->type == EDITVERT) ese->data = EM_get_vert_for_index(mselect->index); else

View File

@@ -1080,8 +1080,8 @@ int *mesh_get_x_mirror_faces(Object *ob, EditMesh *em)
/* make sure v4 is not 0 if a quad */
if(mf->v4 && mirrormf.v4==0) {
SWAP(int, mirrormf.v1, mirrormf.v3);
SWAP(int, mirrormf.v2, mirrormf.v4);
SWAP(unsigned int, mirrormf.v1, mirrormf.v3);
SWAP(unsigned int, mirrormf.v2, mirrormf.v4);
}
hashmf= BLI_ghash_lookup(fhash, &mirrormf);

View File

@@ -1666,6 +1666,47 @@ static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_FINISHED;
}
static int region_scale_get_maxsize(RegionMoveData *rmd)
{
int maxsize= 0;
if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
return rmd->sa->winx - UI_UNIT_X;
}
if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
/* this calculation seems overly verbose
* can someone explain why this method is necessary? - campbell */
maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
}
return maxsize;
}
static void region_scale_validate_size(RegionMoveData *rmd)
{
if((rmd->ar->flag & RGN_FLAG_HIDDEN)==0) {
short *size, maxsize= -1;
if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT)
size= &rmd->ar->sizex;
else
size= &rmd->ar->sizey;
maxsize= region_scale_get_maxsize(rmd);
if(*size > maxsize && maxsize > 0)
*size= maxsize;
}
}
static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd)
{
ED_region_toggle_hidden(C, rmd->ar);
region_scale_validate_size(rmd);
}
static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
{
RegionMoveData *rmd= op->customdata;
@@ -1685,35 +1726,31 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
if(rmd->ar->sizex < UI_UNIT_X) {
rmd->ar->sizex= rmd->origval;
if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
ED_region_toggle_hidden(C, rmd->ar);
region_scale_toggle_hidden(C, rmd);
}
else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
ED_region_toggle_hidden(C, rmd->ar);
region_scale_toggle_hidden(C, rmd);
}
else {
int maxsize=0;
int maxsize= region_scale_get_maxsize(rmd);
delta= event->y - rmd->origy;
if(rmd->edge==AE_BOTTOM_TO_TOPLEFT) delta= -delta;
rmd->ar->sizey= rmd->origval + delta;
CLAMP(rmd->ar->sizey, 0, rmd->maxsize);
if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
/* this calculation seems overly verbose
* can someone explain why this method is necessary? - campbell */
maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
}
/* note, 'UI_UNIT_Y/4' means you need to drag the header almost
* all the way down for it to become hidden, this is done
* otherwise its too easy to do this by accident */
if(rmd->ar->sizey < UI_UNIT_Y/4 || (maxsize > 0 && (rmd->ar->sizey > maxsize)) ) {
if(rmd->ar->sizey < UI_UNIT_Y/4) {
rmd->ar->sizey= rmd->origval;
if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
ED_region_toggle_hidden(C, rmd->ar);
region_scale_toggle_hidden(C, rmd);
}
else if(maxsize > 0 && (rmd->ar->sizey > maxsize))
rmd->ar->sizey= maxsize;
else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
ED_region_toggle_hidden(C, rmd->ar);
region_scale_toggle_hidden(C, rmd);
}
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
@@ -1725,10 +1762,14 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
if(ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) {
if(rmd->ar->flag & RGN_FLAG_HIDDEN) {
ED_region_toggle_hidden(C, rmd->ar);
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
region_scale_toggle_hidden(C, rmd);
}
else if(rmd->ar->flag & RGN_FLAG_TOO_SMALL) {
region_scale_validate_size(rmd);
}
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
MEM_freeN(op->customdata);
op->customdata = NULL;

View File

@@ -1816,7 +1816,9 @@ static int project_bucket_isect_circle(const float cent[2], const float radius_s
return 1;
*/
if((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) ) {
if ( (bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) ||
(bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1]) )
{
return 1;
}
@@ -2816,7 +2818,11 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
p4[0] = bucket_bounds.xmax; p4[1] = bucket_bounds.ymin;
if (mf->v4) {
if( isect_point_quad_v2(p1, v1, v2, v3, v4) || isect_point_quad_v2(p2, v1, v2, v3, v4) || isect_point_quad_v2(p3, v1, v2, v3, v4) || isect_point_quad_v2(p4, v1, v2, v3, v4) ||
if ( isect_point_quad_v2(p1, v1, v2, v3, v4) ||
isect_point_quad_v2(p2, v1, v2, v3, v4) ||
isect_point_quad_v2(p3, v1, v2, v3, v4) ||
isect_point_quad_v2(p4, v1, v2, v3, v4) ||
/* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
(isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3) || isect_line_line_v2(p1, p2, v3, v4)) ||
(isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3) || isect_line_line_v2(p2, p3, v3, v4)) ||
@@ -2827,7 +2833,10 @@ static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucke
}
}
else {
if( isect_point_tri_v2(p1, v1, v2, v3) || isect_point_tri_v2(p2, v1, v2, v3) || isect_point_tri_v2(p3, v1, v2, v3) || isect_point_tri_v2(p4, v1, v2, v3) ||
if ( isect_point_tri_v2(p1, v1, v2, v3) ||
isect_point_tri_v2(p2, v1, v2, v3) ||
isect_point_tri_v2(p3, v1, v2, v3) ||
isect_point_tri_v2(p4, v1, v2, v3) ||
/* we can avoid testing v3,v1 because another intersection MUST exist if this intersects */
(isect_line_line_v2(p1, p2, v1, v2) || isect_line_line_v2(p1, p2, v2, v3)) ||
(isect_line_line_v2(p2, p3, v1, v2) || isect_line_line_v2(p2, p3, v2, v3)) ||

View File

@@ -41,6 +41,7 @@ struct Mesh;
struct Object;
struct PaintStroke;
struct PointerRNA;
struct rcti;
struct Scene;
struct VPaint;
struct ViewContext;
@@ -104,6 +105,26 @@ void PAINT_OT_image_from_view(struct wmOperatorType *ot);
/* paint_utils.c */
/* Convert the object-space axis-aligned bounding box (expressed as
its minimum and maximum corners) into a screen-space rectangle,
returns zero if the result is empty */
int paint_convert_bb_to_rect(struct rcti *rect,
const float bb_min[3],
const float bb_max[3],
const struct ARegion *ar,
struct RegionView3D *rv3d,
struct Object *ob);
/* Get four planes in object-space that describe the projection of
screen_rect from screen into object-space (essentially converting a
2D screens-space bounding box into four 3D planes) */
void paint_calc_redraw_planes(float planes[4][4],
const struct ARegion *ar,
struct RegionView3D *rv3d,
struct Object *ob,
const struct rcti *screen_rect);
void projectf(struct bglMats *mats, const float v[3], float p[2]);
float paint_calc_object_space_radius(struct ViewContext *vc, float center[3], float pixel_radius);
float paint_get_tex_pixel(struct Brush* br, float u, float v);

View File

@@ -123,19 +123,19 @@ static int same_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
{
MTex* mtex = &brush->mtex;
return
(mtex->tex &&
mtex->ofs[0] == snap->ofs[0] &&
mtex->ofs[1] == snap->ofs[1] &&
mtex->ofs[2] == snap->ofs[2] &&
mtex->size[0] == snap->size[0] &&
mtex->size[1] == snap->size[1] &&
mtex->size[2] == snap->size[2] &&
mtex->rot == snap->rot) &&
((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && brush_size(brush) <= snap->brush_size) || (brush_size(brush) == snap->brush_size)) && // make brush smaller shouldn't cause a resample
mtex->brush_map_mode == snap->brush_map_mode &&
vc->ar->winx == snap->winx &&
vc->ar->winy == snap->winy;
return ( (mtex->tex) &&
equals_v3v3(mtex->ofs, snap->ofs) &&
equals_v3v3(mtex->size, snap->size) &&
mtex->rot == snap->rot
) &&
/* make brush smaller shouldn't cause a resample */
( (mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && (brush_size(brush) <= snap->brush_size)) ||
(brush_size(brush) == snap->brush_size)) &&
(mtex->brush_map_mode == snap->brush_map_mode) &&
(vc->ar->winx == snap->winx) &&
(vc->ar->winy == snap->winy);
}
static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
@@ -869,7 +869,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
MEM_freeN(stroke);
return OPERATOR_FINISHED;
}
else if(first || ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (event->type == TIMER && (event->customdata == stroke->timer))) {
else if( (first) ||
(ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
(event->type == TIMER && (event->customdata == stroke->timer)) )
{
if(stroke->stroke_started) {
if(paint_smooth_stroke(stroke, mouse, event)) {
if(paint_space_stroke_enabled(stroke->brush)) {
@@ -887,7 +890,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
/* we want the stroke to have the first daub at the start location instead of waiting till we have moved the space distance */
/* we want the stroke to have the first daub at the start location
* instead of waiting till we have moved the space distance */
if(first &&
stroke->stroke_started &&
paint_space_stroke_enabled(stroke->brush) &&

View File

@@ -67,6 +67,78 @@
#include "paint_intern.h"
/* Convert the object-space axis-aligned bounding box (expressed as
its minimum and maximum corners) into a screen-space rectangle,
returns zero if the result is empty */
int paint_convert_bb_to_rect(rcti *rect,
const float bb_min[3],
const float bb_max[3],
const ARegion *ar,
RegionView3D *rv3d,
Object *ob)
{
float projection_mat[4][4];
int i, j, k;
rect->xmin = rect->ymin = INT_MAX;
rect->xmax = rect->ymax = INT_MIN;
/* return zero if the bounding box has non-positive volume */
if(bb_min[0] > bb_max[0] || bb_min[1] > bb_max[1] || bb_min[2] > bb_max[2])
return 0;
ED_view3d_ob_project_mat_get(rv3d, ob, projection_mat);
for(i = 0; i < 2; ++i) {
for(j = 0; j < 2; ++j) {
for(k = 0; k < 2; ++k) {
float vec[3], proj[2];
vec[0] = i ? bb_min[0] : bb_max[0];
vec[1] = j ? bb_min[1] : bb_max[1];
vec[2] = k ? bb_min[2] : bb_max[2];
/* convert corner to screen space */
ED_view3d_project_float(ar, vec, proj,
projection_mat);
/* expand 2D rectangle */
rect->xmin = MIN2(rect->xmin, proj[0]);
rect->xmax = MAX2(rect->xmax, proj[0]);
rect->ymin = MIN2(rect->ymin, proj[1]);
rect->ymax = MAX2(rect->ymax, proj[1]);
}
}
}
/* return false if the rectangle has non-positive area */
return rect->xmin < rect->xmax && rect->ymin < rect->ymax;
}
/* Get four planes in object-space that describe the projection of
screen_rect from screen into object-space (essentially converting a
2D screens-space bounding box into four 3D planes) */
void paint_calc_redraw_planes(float planes[4][4],
const ARegion *ar,
RegionView3D *rv3d,
Object *ob,
const rcti *screen_rect)
{
BoundBox bb;
bglMats mats;
rcti rect;
memset(&bb, 0, sizeof(BoundBox));
view3d_get_transformation(ar, rv3d, ob, &mats);
/* use some extra space just in case */
rect = *screen_rect;
rect.xmin -= 2;
rect.xmax += 2;
rect.ymin -= 2;
rect.ymax += 2;
ED_view3d_calc_clipping(&bb, planes, &mats, &rect);
mul_m4_fl(planes, -1.0f);
}
/* convert a point in model coordinates to 2D screen coordinates */
/* TODO: can be deleted once all calls are replaced with
view3d_project_float() */

Some files were not shown because too many files have changed in this diff Show More