[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36957] trunk/blender/source/gameengine/ VideoTexture/VideoFFmpeg.cpp: fix for ffmpeg linking in BGE ( patch by Jens Verwiebe (jensverwiebe) over IRC)
Revision: 36957 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36957 Author: dfelinto Date: 2011-05-27 21:13:44 + (Fri, 27 May 2011) Log Message: --- fix for ffmpeg linking in BGE (patch by Jens Verwiebe (jensverwiebe) over IRC) - av_parse_video_rate(&frameRate, rateStr); + av_parse_video_frame_rate(&frameRate, rateStr); Modified Paths: -- trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp Modified: trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp === --- trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-05-27 20:57:46 UTC (rev 36956) +++ trunk/blender/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-05-27 21:13:44 UTC (rev 36957) @@ -641,7 +641,7 @@ if (m_captRate <= 0.f) m_captRate = defFrameRate; sprintf(rateStr, "%f", m_captRate); - av_parse_video_rate(&frameRate, rateStr); + av_parse_video_frame_rate(&frameRate, rateStr); // populate format parameters // need to specify the time base = inverse of rate formatParams.time_base.num = frameRate.den; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36964] trunk/blender/source/gameengine/ BlenderRoutines/BL_KetsjiEmbedStart.cpp: fix for embeded BGE viewport broken when not using letterboxing
Revision: 36964 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36964 Author: dfelinto Date: 2011-05-28 01:29:56 + (Sat, 28 May 2011) Log Message: --- fix for embeded BGE viewport broken when not using letterboxing this was broken after rev.36787 (api rewritten) own reported bug, nowhere in the track (just to mess up with the bug fixing statistics) Modified Paths: -- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp Modified: trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp === --- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2011-05-28 00:07:33 UTC (rev 36963) +++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2011-05-28 01:29:56 UTC (rev 36964) @@ -258,7 +258,7 @@ draw_letterbox = 1; } else { - camzoom = BKE_screen_view3d_zoom_to_fac(rv3d->camzoom); + camzoom = BKE_screen_view3d_zoom_to_fac(rv3d->camzoom)*4.0f; } } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36970] trunk/blender/source/gameengine/ Ketsji/KX_PyConstraintBinding.cpp: bugfix for: [#26753] PhysicsConstraints ID trouble on 64bit (linux at leas
Revision: 36970 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36970 Author: dfelinto Date: 2011-05-28 08:16:34 + (Sat, 28 May 2011) Log Message: --- bugfix for: [#26753] PhysicsConstraints ID trouble on 64bit (linux at least). [the problem also affected OSX] PhysicsId are Long, not ints (see PyObject* KX_GameObject::PyGetPhysicsId() ) There is a reference in the code to use PyCapsule instead of int. I'm not sure about that. This patch at least stops the crashes (update: I talked with Campbell and he repeated that PyCapsule are better, but if long is working it's fine for now). Modified Paths: -- trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp Modified: trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp 2011-05-28 07:47:58 UTC (rev 36969) +++ trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp 2011-05-28 08:16:34 UTC (rev 36970) @@ -405,8 +405,13 @@ PyObject* args, PyObject* kwds) { - /* FIXME - physicsid is an int being cast to a pointer, should at least use PyCapsule */ - int physicsid=0,physicsid2 = 0,constrainttype=0,extrainfo=0; + /* FIXME - physicsid is a long being cast to a pointer, should at least use PyCapsule */ +#if defined(_WIN64) + __int64 physicsid=0,physicsid2 = 0; +#else + long physicsid=0,physicsid2 = 0; +#endif + int constrainttype=0, extrainfo=0; int len = PyTuple_Size(args); int success = 1; int flag = 0; @@ -414,27 +419,51 @@ float pivotX=1,pivotY=1,pivotZ=1,axisX=0,axisY=0,axisZ=1; if (len == 3) { - success = PyArg_ParseTuple(args,"iii",&physicsid,&physicsid2,&constrainttype); +#if defined(_WIN64) + success = PyArg_ParseTuple(args,"LLi",&physicsid,&physicsid2,&constrainttype); +#else + success = PyArg_ParseTuple(args,"lli",&physicsid,&physicsid2,&constrainttype); +#endif } else if (len ==6) { - success = PyArg_ParseTuple(args,"iiifff",&physicsid,&physicsid2,&constrainttype, +#if defined(_WIN64) + success = PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype, &pivotX,&pivotY,&pivotZ); +#else + success = PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ); +#endif } else if (len == 9) { - success = PyArg_ParseTuple(args,"iiiff",&physicsid,&physicsid2,&constrainttype, +#if defined(_WIN64) + success = PyArg_ParseTuple(args,"LLiff",&physicsid,&physicsid2,&constrainttype, &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); +#else + success = PyArg_ParseTuple(args,"lliff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); +#endif + } else if (len == 10) { - success = PyArg_ParseTuple(args,"iiiffi",&physicsid,&physicsid2,&constrainttype, +#if defined(_WIN64) + success = PyArg_ParseTuple(args,"LLiffi",&physicsid,&physicsid2,&constrainttype, &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); +#else + success = PyArg_ParseTuple(args,"lliffi",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); +#endif } else if (len==4) { - success = PyArg_ParseTuple(args,"",&physicsid,&physicsid2,&constrainttype,&extrainfo); +#if defined(_WIN64) + success = PyArg_ParseTuple(args,"LLii",&physicsid,&physicsid2,&constrainttype,&extrainfo); +#else + success = PyArg_ParseTuple(args,"llii",&physicsid,&physicsid2,&constrainttype,&extrainfo); +#endif pivotX=extrainfo; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37117] trunk/blender/source/blender/ makesrna/intern/rna_actuator.c: BugFix: [#27556] Replace mesh for gfx in " Edit Object" actuator act illogically
Revision: 37117 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37117 Author: dfelinto Date: 2011-06-03 07:53:55 + (Fri, 03 Jun 2011) Log Message: --- BugFix: [#27556] Replace mesh for gfx in "Edit Object" actuator act illogically + other booleans that are flipped Now I think we are all good. We still have a few actuators that were using TOGN before but that I didn't make as negative_boolean. All fixed now: - parent actuator - edit object actuator - action actuator - shape actuator Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_actuator.c Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c === --- trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2011-06-03 05:51:39 UTC (rev 37116) +++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c 2011-06-03 07:53:55 UTC (rev 37117) @@ -584,7 +584,7 @@ RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1); + RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1); RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time"); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -1383,7 +1383,7 @@ RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_replace_display_mesh", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_EDOB_REPLACE_MESH_NOGFX); RNA_def_property_ui_text(prop, "Gfx", "Replace the display mesh"); RNA_def_property_update(prop, NC_LOGIC, NULL); @@ -1769,12 +1769,12 @@ /* booleans */ prop= RNA_def_property(srna, "use_compound", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_COMPOUND); RNA_def_property_ui_text(prop, "Compound", "Add this object shape to the parent shape (only if the parent shape is already compound)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_ghost", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_PARENT_GHOST); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ACT_PARENT_GHOST); RNA_def_property_ui_text(prop, "Ghost", "Make this object ghost while parented"); RNA_def_property_update(prop, NC_LOGIC, NULL); } @@ -1816,7 +1816,7 @@ RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "end_reset", 1); + RNA_def_property_boolean_negative_sdna(prop, NULL, "end_reset", 1); RNA_def_property_ui_text(prop, "Continue", "Restore last frame when switching on/off, otherwise play from the start each time"); RNA_def_property_update(prop, NC_LOGIC, NULL); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37231] trunk/blender/release/scripts/ startup/bl_ui/properties_object_constraint.py: replacing -> arrows by proper ASCII arrows on Transformation Con
Revision: 37231 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37231 Author: dfelinto Date: 2011-06-05 23:38:11 + (Sun, 05 Jun 2011) Log Message: --- replacing -> arrows by proper ASCII arrows on Transformation Constraint Note: Text Editor doesn't support this chr(187) properly. I hardcoded and commented the ui file. I hope it's fine. Modified Paths: -- trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py Modified: trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py === --- trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py 2011-06-05 23:14:59 UTC (rev 37230) +++ trunk/blender/release/scripts/startup/bl_ui/properties_object_constraint.py 2011-06-05 23:38:11 UTC (rev 37231) @@ -655,17 +655,19 @@ row = col.row() row.label(text="Source to Destination Mapping:") + # note: chr(187) is the ASCII arrow ( >> ). Blender Text Editor can't + # open it. Thus we are using the hardcoded value instead. row = col.row() row.prop(con, "map_to_x_from", expand=False, text="") -row.label(text=" -> X") +row.label(text=" %sX" % chr(187)) row = col.row() row.prop(con, "map_to_y_from", expand=False, text="") -row.label(text=" -> Y") +row.label(text=" %sY" % chr(187)) row = col.row() row.prop(con, "map_to_z_from", expand=False, text="") -row.label(text=" -> Z") +row.label(text=" %sZ" % chr(187)) split = layout.split() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37312] trunk/lib/tests/gameengine_visual: updated files to Bleder 2.5 BGE API
Revision: 37312 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37312 Author: dfelinto Date: 2011-06-08 07:20:02 + (Wed, 08 Jun 2011) Log Message: --- updated files to Bleder 2.5 BGE API (note videotexture seems extremely slow in some systems) Modified Paths: -- trunk/lib/tests/gameengine_visual/lampRGB.blend trunk/lib/tests/gameengine_visual/screenspace.blend trunk/lib/tests/gameengine_visual/videotexture/MirrorTextureDemo.blend trunk/lib/tests/gameengine_visual/videotexture/VideoTextureDemo.blend Modified: trunk/lib/tests/gameengine_visual/lampRGB.blend === (Binary files differ) Modified: trunk/lib/tests/gameengine_visual/screenspace.blend === (Binary files differ) Modified: trunk/lib/tests/gameengine_visual/videotexture/MirrorTextureDemo.blend === (Binary files differ) Modified: trunk/lib/tests/gameengine_visual/videotexture/VideoTextureDemo.blend === (Binary files differ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37313] trunk/lib/tests/gameengine_visual/ videotexture/MirrorTextureDemo.blend: changing ob color to white ( it seems the obcolor 'bug' is chasing me
Revision: 37313 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37313 Author: dfelinto Date: 2011-06-08 07:27:00 + (Wed, 08 Jun 2011) Log Message: --- changing ob color to white (it seems the obcolor 'bug' is chasing me ;) -- sorry I tested the files in an old Blender In a side good note: the videos are playing smoothly here comparing to the old one. FFMPEG update really helped here. Modified Paths: -- trunk/lib/tests/gameengine_visual/videotexture/MirrorTextureDemo.blend Modified: trunk/lib/tests/gameengine_visual/videotexture/MirrorTextureDemo.blend === (Binary files differ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37314] trunk/blender/source/gameengine/ BlenderRoutines/BL_KetsjiEmbedStart.cpp: fix of fix :| [ real fix for #36787 -- it was wrongly fixed on #3696
Revision: 37314 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37314 Author: dfelinto Date: 2011-06-08 09:01:41 + (Wed, 08 Jun 2011) Log Message: --- fix of fix :| [real fix for #36787 -- it was wrongly fixed on #36964] I guess I tested the fix outside the camera view (which always worked). duhhh Working now. Modified Paths: -- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp Modified: trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp === --- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2011-06-08 07:27:00 UTC (rev 37313) +++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp 2011-06-08 09:01:41 UTC (rev 37314) @@ -258,7 +258,7 @@ draw_letterbox = 1; } else { - camzoom = BKE_screen_view3d_zoom_to_fac(rv3d->camzoom)*4.0f; + camzoom = 1.0 / BKE_screen_view3d_zoom_to_fac(rv3d->camzoom); } } else { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37427] trunk/blender/source/blender/ makesrna/intern/rna_controller.c: Logic: clear "Script" when setting Script Controller mode to "Module"
Revision: 37427 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37427 Author: dfelinto Date: 2011-06-12 08:34:53 + (Sun, 12 Jun 2011) Log Message: --- Logic: clear "Script" when setting Script Controller mode to "Module" The text datablock was linked to the controller. So even if the script was set to 'module' and saved, once linked/appended the object the script would come together. If someone wants to implement this "clear" only once the file is saved, please go ahead. But I believe it's ok to loose the script if you change it for module (and with the new datablock lookup it's straightforward/quick to reassign a textblock) -- bug not reported anywhere, from my own list Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_controller.c Modified: trunk/blender/source/blender/makesrna/intern/rna_controller.c === --- trunk/blender/source/blender/makesrna/intern/rna_controller.c 2011-06-12 04:47:06 UTC (rev 37426) +++ trunk/blender/source/blender/makesrna/intern/rna_controller.c 2011-06-12 08:34:53 UTC (rev 37427) @@ -87,6 +87,20 @@ } } +static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) +{ + bController *cont= (bController *)ptr->data; + bPythonCont *pycon= (bPythonCont *)cont->data; + + // if mode changed and previous mode were Script + if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) + { + // clear script to avoid it to get linked with the controller + pycon->text = NULL; + } + pycon->mode = value; +} + static int rna_Controller_state_number_get(struct PointerRNA *ptr) { bController *cont= (bController *)ptr->data; @@ -222,6 +236,7 @@ prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, python_controller_modes); + RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); RNA_def_property_update(prop, NC_LOGIC, NULL); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37455] trunk/blender: BGE Patch: [#27425] Allow to change the damping of the camera actuator
Revision: 37455 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37455 Author: dfelinto Date: 2011-06-13 17:08:33 + (Mon, 13 Jun 2011) Log Message: --- BGE Patch: [#27425] Allow to change the damping of the camera actuator ## original name: "Allow to change the strenght of the "go behind" constraint of the camera actuator" The camera actuator is an actuator that drive the camera to follow an object, with a set of constraint. Currently, when the object followed rotate on himself (like a person, or an helicopter), the camera is really slow to go behind (at least 10 seconds). This patch gives the UI to tweak the strenght of the 'go behind'[named damping] constraint. ### epydocs (rst) updated too Modified Paths: -- trunk/blender/doc/python_api/rst/bge.types.rst trunk/blender/source/blender/blenkernel/intern/sca.c trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/editors/space_logic/logic_window.c trunk/blender/source/blender/makesdna/DNA_actuator_types.h trunk/blender/source/blender/makesrna/intern/rna_actuator.c trunk/blender/source/gameengine/Converter/KX_ConvertActuators.cpp trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.h Modified: trunk/blender/doc/python_api/rst/bge.types.rst === --- trunk/blender/doc/python_api/rst/bge.types.rst 2011-06-13 15:07:36 UTC (rev 37454) +++ trunk/blender/doc/python_api/rst/bge.types.rst 2011-06-13 17:08:33 UTC (rev 37455) @@ -710,6 +710,12 @@ Applies changes to a camera. + .. attribute:: damping + + strength of of the camera following movement. + + :type: float + .. attribute:: min minimum distance to the target object maintained by the actuator. Modified: trunk/blender/source/blender/blenkernel/intern/sca.c === --- trunk/blender/source/blender/blenkernel/intern/sca.c2011-06-13 15:07:36 UTC (rev 37454) +++ trunk/blender/source/blender/blenkernel/intern/sca.c2011-06-13 17:08:33 UTC (rev 37455) @@ -430,6 +430,7 @@ act->data= MEM_callocN(sizeof(bCameraActuator), "camact"); ca = act->data; ca->axis = ACT_CAMERA_X; + ca->damping = 1.0/32.0; break; case ACT_EDIT_OBJECT: act->data= MEM_callocN(sizeof(bEditObjectActuator), "editobact"); Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-06-13 15:07:36 UTC (rev 37454) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-06-13 17:08:33 UTC (rev 37455) @@ -11647,6 +11647,21 @@ } } } + + { + /* add default value for behind strength of camera actuator */ + Object *ob; + bActuator *act; + for(ob = main->object.first; ob; ob= ob->id.next) { + for(act= ob->actuators.first; act; act= act->next) { + if (act->type == ACT_CAMERA) { + bCameraActuator *ba= act->data; + + ba->damping = 1.0/32.0; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c === --- trunk/blender/source/blender/editors/space_logic/logic_window.c 2011-06-13 15:07:36 UTC (rev 37454) +++ trunk/blender/source/blender/editors/space_logic/logic_window.c 2011-06-13 17:08:33 UTC (rev 37455) @@ -3786,6 +3786,8 @@ row = uiLayoutRow(layout, 1); uiItemR(row, ptr, "min", 0, NULL, ICON_NONE); uiItemR(row, ptr, "max", 0, NULL, ICON_NONE); + + uiItemR(layout, ptr, "damping", 0, NULL, ICON_NONE); } static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext *C) Modified: trunk/blender/source/blender/makesdna/DNA_actuator_types.h === --- trunk/blender/source/blender/makesdna/DNA_actuator_types.h 2011-06-13 15:07:36 UTC (rev 37454) +++ trunk/blender/source/blender/makesdna/DNA_actuator_types.h 2011-06-13 17:08:33 UTC (rev 37455) @@ -133,7 +133,7 @@ typedef struct bCameraActuator { struct Object *ob; float height, min,
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37677] trunk/blender/source/blender/ blenkernel/CMakeLists.txt: fix for build with cmake (patch by Joerg Mueller )
Revision: 37677 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37677 Author: dfelinto Date: 2011-06-20 22:44:35 + (Mon, 20 Jun 2011) Log Message: --- fix for build with cmake (patch by Joerg Mueller) Modified Paths: -- trunk/blender/source/blender/blenkernel/CMakeLists.txt Modified: trunk/blender/source/blender/blenkernel/CMakeLists.txt === --- trunk/blender/source/blender/blenkernel/CMakeLists.txt 2011-06-20 21:34:23 UTC (rev 37676) +++ trunk/blender/source/blender/blenkernel/CMakeLists.txt 2011-06-20 22:44:35 UTC (rev 37677) @@ -284,7 +284,7 @@ if(WITH_PYTHON) list(APPEND INC ../python) - # list(APPEND INC_SYS ${PYTHON_INCLUDE_DIRS}) # for pynodes, commented now + list(APPEND INC_SYS ${PYTHON_INCLUDE_DIRS}) add_definitions(-DWITH_PYTHON) if(WITH_PYTHON_SECURITY) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37773] trunk/blender/source/gameengine/ Converter/BL_BlenderDataConversion.cpp: revert commit 27133: Committing patch [#27133] "Fix for for Object Co
Revision: 37773 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37773 Author: dfelinto Date: 2011-06-23 22:29:02 + (Thu, 23 Jun 2011) Log Message: --- revert commit 27133: Committing patch [#27133] "Fix for for Object Color in BGE" by Kupoman This was causing a lot of backward compatibility problems and side effects. It has to be done properly, linked with Material ObjectColor shader_flag or at least the TF OBCOLOR (which apparently worked at some point so I've been told). If you need to use OBCOLOR simply keyframe the obcolor and it will work as before. Modified Paths: -- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp Modified: trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp === --- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2011-06-23 22:23:46 UTC (rev 37772) +++ trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2011-06-23 22:29:02 UTC (rev 37773) @@ -1840,7 +1840,6 @@ { gameobj->SetLayer(ob->lay); gameobj->SetBlenderObject(ob); - gameobj->SetObjectColor(ob->col); /* set the visibility state based on the objects render option in the outliner */ if(ob->restrictflag & OB_RESTRICT_RENDER) gameobj->SetVisible(0, 0); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37823] trunk/blender/source/blender/ makesrna/intern/rna_ID.c: Fix in texts for Mesh.materials.pop()
Revision: 37823 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37823 Author: dfelinto Date: 2011-06-26 09:10:54 + (Sun, 26 Jun 2011) Log Message: --- Fix in texts for Mesh.materials.pop() found by accident while studying how to append materials from python ;) Modified Paths: -- trunk/blender/source/blender/makesrna/intern/rna_ID.c Modified: trunk/blender/source/blender/makesrna/intern/rna_ID.c === --- trunk/blender/source/blender/makesrna/intern/rna_ID.c 2011-06-26 08:42:00 UTC (rev 37822) +++ trunk/blender/source/blender/makesrna/intern/rna_ID.c 2011-06-26 09:10:54 UTC (rev 37823) @@ -415,10 +415,10 @@ RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "pop", "material_pop_id"); - RNA_def_function_ui_description(func, "Add a new material to Mesh."); - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Frame number to set.", 0, INT_MAX); + RNA_def_function_ui_description(func, "Remove a material from Mesh."); + parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of material to remove.", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "material", "Material", "", "Material to add."); + parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove."); RNA_def_function_return(func, parm); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37846] trunk/blender/doc/python_api/ examples/aud.py: basic sound playback example for audspace module
Revision: 37846 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37846 Author: dfelinto Date: 2011-06-27 05:12:03 + (Mon, 27 Jun 2011) Log Message: --- basic sound playback example for audspace module (I'm on windows at the moment so I can't test it. Hopefully it should be fine) Added Paths: --- trunk/blender/doc/python_api/examples/aud.py Added: trunk/blender/doc/python_api/examples/aud.py === --- trunk/blender/doc/python_api/examples/aud.py (rev 0) +++ trunk/blender/doc/python_api/examples/aud.py2011-06-27 05:12:03 UTC (rev 37846) @@ -0,0 +1,21 @@ +""" +Basic Sound Playback +++ +This script shows how to use the classes: :class:`Device`, :class:`Factory` and +:class:`Handle`. +""" +import aud + +device = aud.device() +# load sound file (it can be a video file with audio) +factory = aud.Factory('music.ogg') + +# play the audio, this return a handle to control play/pause +handle = device.play(sound) +# if the audio is not too big and will be used often you can buffer it +factory_buffered = aud.Factory.buffer(sound) +handle_buffered = device.play(buffered) + +# stop the sounds (otherwise they play until their ends) +handle.stop() +handle_buffered.stop() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38100] trunk/blender/build_files/scons/ tools/Blender.py: blenderplayer bundle in OSX doesn't need script folder ( untested)
Revision: 38100 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38100 Author: dfelinto Date: 2011-07-05 00:30:27 + (Tue, 05 Jul 2011) Log Message: --- blenderplayer bundle in OSX doesn't need script folder (untested) I can't test this here, somehow blender+scons is failing in my building env. but it should work. Basically it skips the copy of the script folder for the blenderplayer.app I will test it once buildbot get pass this review ;) Modified Paths: -- trunk/blender/build_files/scons/tools/Blender.py Modified: trunk/blender/build_files/scons/tools/Blender.py === --- trunk/blender/build_files/scons/tools/Blender.py2011-07-05 00:29:37 UTC (rev 38099) +++ trunk/blender/build_files/scons/tools/Blender.py2011-07-05 00:30:27 UTC (rev 38100) @@ -565,13 +565,16 @@ cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION) commands.getoutput(cmd) cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION) -commands.getoutput(cmd) -cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) commands.getoutput(cmd) -cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) -commands.getoutput(cmd) -cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) -commands.getoutput(cmd) + +if binary == 'blender':#not copy everything for blenderplayer +cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) +commands.getoutput(cmd) +cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) +commands.getoutput(cmd) +cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION) +commands.getoutput(cmd) + cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary) commands.getoutput(cmd) cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38135] trunk/blender/doc/python_api/rst: patch [#27871] bge.texture documentation from Solano Fel?\195?\173cio ( + changes from me) it still needs wo
Revision: 38135 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38135 Author: dfelinto Date: 2011-07-06 07:05:29 + (Wed, 06 Jul 2011) Log Message: --- patch [#27871] bge.texture documentation from Solano Fel?\195?\173cio (+ changes from me) it still needs work ... and I can't test rst in windows so for now let's pretend it builds. If someone can generate the docs and see how it goes please let me know. (plus a small fix for bge.logic rst) Modified Paths: -- trunk/blender/doc/python_api/rst/bge.logic.rst Added Paths: --- trunk/blender/doc/python_api/rst/bge.texture.rst Modified: trunk/blender/doc/python_api/rst/bge.logic.rst === --- trunk/blender/doc/python_api/rst/bge.logic.rst 2011-07-06 01:34:10 UTC (rev 38134) +++ trunk/blender/doc/python_api/rst/bge.logic.rst 2011-07-06 07:05:29 UTC (rev 38135) @@ -17,7 +17,7 @@ # To get the game object this controller is on: obj = cont.owner -:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`bge.types.~KX_LightObject` methods are available depending on the type of object +:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`~bge.types.KX_LightObject` methods are available depending on the type of object .. code-block:: python Added: trunk/blender/doc/python_api/rst/bge.texture.rst === --- trunk/blender/doc/python_api/rst/bge.texture.rst (rev 0) +++ trunk/blender/doc/python_api/rst/bge.texture.rst2011-07-06 07:05:29 UTC (rev 38135) @@ -0,0 +1,480 @@ + +Game Engine bge.texture Module +== +.. note:: + This documentation is still very weak, and needs some help! Right now they are mostly a collection + of the docstrings found in the bge.texture source code + some random places filled with text. + +* +Intro +* + +The bge.texture module allows you to manipulate textures during the game. + +Several sources for texture are possible: video files, image files, video capture, memory buffer, camera render or a mix of that. + +The video and image files can be loaded from the internet using an URL instead of a file name. + +In addition, you can apply filters on the images before sending them to the GPU, allowing video effect: blue screen, color band, gray, normal map. + +bge.texture uses FFmpeg to load images and videos. All the formats and codecs that FFmpeg supports are supported by this module, including but not limited to:: + + * AVI + * Ogg + * Xvid + * Theora + * dv1394 camera + * video4linux capture card (this includes many webcams) + * videoForWindows capture card (this includes many webcams) + * JPG + +The principle is simple: first you identify a texture on an existing object using +the :materialID: function, then you create a new texture with dynamic content +and swap the two textures in the GPU. + +The GE is not aware of the substitution and continues to display the object as always, +except that you are now in control of the texture. + +When the texture object is deleted, the new texture is deleted and the old texture restored. + +.. module:: bge.texture + +.. code-block:: python + +import bge + from bge import texture +from bge import logic + +cont = logic.getCurrentController() +obj = cont.owner + +# the creation of the texture must be done once: save the +# texture object in an attribute of GameLogic module makes it persistent +if not hasattr(logic, 'video'): + +# identify a static texture by name +matID = texture.materialID(obj, 'IMvideo.png') + +# create a dynamic texture that will replace the static texture +logic.video = texture.Texture(obj, matID) + +# define a source of image for the texture, here a movie +movie = logic.expandPath('//trailer_400p.ogg') +logic.video.source = texture.VideoFFmpeg(movie) +logic.video.source.scale = True + +# quick off the movie, but it wont play in the background +logic.video.source.play() + +# you need to call this function every frame to ensure update of the texture. +logic.video.refresh(True) + +.. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0]) + + FFmpeg video source + + .. attribute:: status + video status + + .. attribute:: range + replay range + + .. attribute:: repeat + repeat count, -1 for infinite repeat + + :type: int + + .. attribute:: framerate + frame rate + +
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38136] trunk/blender/doc/python_api: moving bge.texture example to an external file
Revision: 38136 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38136 Author: dfelinto Date: 2011-07-06 07:15:56 + (Wed, 06 Jul 2011) Log Message: --- moving bge.texture example to an external file Modified Paths: -- trunk/blender/doc/python_api/rst/bge.texture.rst Added Paths: --- trunk/blender/doc/python_api/examples/bge.texture.py Added: trunk/blender/doc/python_api/examples/bge.texture.py === --- trunk/blender/doc/python_api/examples/bge.texture.py (rev 0) +++ trunk/blender/doc/python_api/examples/bge.texture.py2011-07-06 07:15:56 UTC (rev 38136) @@ -0,0 +1,32 @@ +""" +Basic Video Playback +++ +Example of how to replace a texture in game with a video. It needs to run everyframe +""" +import bge +from bge import texture +from bge import logic + +cont = logic.getCurrentController() +obj = cont.owner + +# the creation of the texture must be done once: save the +# texture object in an attribute of bge.logic module makes it persistent +if not hasattr(logic, 'video'): + +# identify a static texture by name +matID = texture.materialID(obj, 'IMvideo.png') + +# create a dynamic texture that will replace the static texture +logic.video = texture.Texture(obj, matID) + +# define a source of image for the texture, here a movie +movie = logic.expandPath('//trailer_400p.ogg') +logic.video.source = texture.VideoFFmpeg(movie) +logic.video.source.scale = True + +# quick off the movie, but it wont play in the background +logic.video.source.play() + +# you need to call this function every frame to ensure update of the texture. +logic.video.refresh(True) \ No newline at end of file Property changes on: trunk/blender/doc/python_api/examples/bge.texture.py ___ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/blender/doc/python_api/rst/bge.texture.rst === --- trunk/blender/doc/python_api/rst/bge.texture.rst2011-07-06 07:05:29 UTC (rev 38135) +++ trunk/blender/doc/python_api/rst/bge.texture.rst2011-07-06 07:15:56 UTC (rev 38136) @@ -1,6 +1,7 @@ Game Engine bge.texture Module == + .. note:: This documentation is still very weak, and needs some help! Right now they are mostly a collection of the docstrings found in the bge.texture source code + some random places filled with text. @@ -38,37 +39,7 @@ When the texture object is deleted, the new texture is deleted and the old texture restored. .. module:: bge.texture - -.. code-block:: python -import bge - from bge import texture -from bge import logic - -cont = logic.getCurrentController() -obj = cont.owner - -# the creation of the texture must be done once: save the -# texture object in an attribute of GameLogic module makes it persistent -if not hasattr(logic, 'video'): - -# identify a static texture by name -matID = texture.materialID(obj, 'IMvideo.png') - -# create a dynamic texture that will replace the static texture -logic.video = texture.Texture(obj, matID) - -# define a source of image for the texture, here a movie -movie = logic.expandPath('//trailer_400p.ogg') -logic.video.source = texture.VideoFFmpeg(movie) -logic.video.source.scale = True - -# quick off the movie, but it wont play in the background -logic.video.source.play() - -# you need to call this function every frame to ensure update of the texture. -logic.video.refresh(True) - .. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0]) FFmpeg video source ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38137] trunk/blender/doc/python_api/ examples/bge.texture.1.py: new example for bge.texture, a basic texture replacement
Revision: 38137 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38137 Author: dfelinto Date: 2011-07-06 07:26:04 + (Wed, 06 Jul 2011) Log Message: --- new example for bge.texture, a basic texture replacement fresh simple and didactic example straight from my bge book, enjoy it ;) video texture documentation online ... tears dropping. Added Paths: --- trunk/blender/doc/python_api/examples/bge.texture.1.py Added: trunk/blender/doc/python_api/examples/bge.texture.1.py === --- trunk/blender/doc/python_api/examples/bge.texture.1.py (rev 0) +++ trunk/blender/doc/python_api/examples/bge.texture.1.py 2011-07-06 07:26:04 UTC (rev 38137) @@ -0,0 +1,38 @@ +""" +Texture replacement +++ +Example of how to replace a texture in game with an external image. +createTexture() and removeTexture() are to be called from a module Python +Controller. +""" +import bge +from bge import logic +from bge import texture + +def createTexture(cont): +"""Create a new Dynamic Texture""" +object = cont.owner + +# get the reference pointer (ID) of the internal texture +ID = VT.materialID(obj, 'IMoriginal.png') + +# create a texture object +object_texture = texture.Texture(object, ID) + +# create a new source with an external image +url = logic.expandPath("//newtexture.jpg") +new_source = texture.ImageFFmpeg(url) + +# the texture has to be stored in a permanent Python object +logic.texture = object_texture + +# update/replace the texture +logic.texture.source = new_source +logic.texture.refresh(False) + +def removeTexture(cont): +"""Delete the Dynamic Texture, reversing back the final to its original state.""" +try: +del logic.texture +except: +pass Property changes on: trunk/blender/doc/python_api/examples/bge.texture.1.py ___ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38138] trunk/blender/doc/python_api/ examples/blf.py: an example for blf - a basic Hello World (for bge, not blender)
Revision: 38138 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38138 Author: dfelinto Date: 2011-07-06 08:29:20 + (Wed, 06 Jul 2011) Log Message: --- an example for blf - a basic Hello World (for bge, not blender) Added Paths: --- trunk/blender/doc/python_api/examples/blf.py Added: trunk/blender/doc/python_api/examples/blf.py === --- trunk/blender/doc/python_api/examples/blf.py (rev 0) +++ trunk/blender/doc/python_api/examples/blf.py2011-07-06 08:29:20 UTC (rev 38138) @@ -0,0 +1,42 @@ +""" +Hello World Text Example + +Blender Game Engine example of using the blf module. For this module to work we +need to use the OpenGL wrapper :class:`~bgl` as well. +""" +# import game engine modules +import bge +from bge import render +from bge import logic +# import stand alone modules +import bgl +import blf + +def init(): +"""init function - runs once""" +# create a new font object, use external ttf file +font_path = logic.expandPath('//Zeyada.ttf') + # store the font indice - to use later +logic.font_id = blf.load(font_path) + +# set the font drawing routine to run every frame +scene = logic.getCurrentScene() +scene.post_draw=[write] + +def write(): +"""write on screen""" +width = render.getWindowWidth() +height = render.getWindowHeight() + +# OpenGL setup +bgl.glMatrixMode(bgl.GL_PROJECTION) +bgl.glLoadIdentity() +bgl.gluOrtho2D(0, width, 0, height) +bgl.glMatrixMode(bgl.GL_MODELVIEW) +bgl.glLoadIdentity() + +# BLF drawing routine +font_id = logic.font_id +blf.position(font_id, (width*0.2), (height*0.3), 0) +blf.size(font_id, 50, 72) +blf.draw(font_id, "Hello World") Property changes on: trunk/blender/doc/python_api/examples/blf.py ___ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38217] trunk/blender/doc/python_api: example of Physics Constraints module :)
Revision: 38217 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38217 Author: dfelinto Date: 2011-07-08 06:51:12 + (Fri, 08 Jul 2011) Log Message: --- example of Physics Constraints module :) + some small fixes in other docs. A topic for later(soon?), I think we should name the modules according to the rest of Blender modules. So instead of: Game Engine bge.logic Module We would have it: Game Logic (bge.logic) ... Modified Paths: -- trunk/blender/doc/python_api/examples/bge.texture.1.py trunk/blender/doc/python_api/examples/blf.py trunk/blender/doc/python_api/rst/bge.events.rst Added Paths: --- trunk/blender/doc/python_api/examples/bge.constraints.py Added: trunk/blender/doc/python_api/examples/bge.constraints.py === --- trunk/blender/doc/python_api/examples/bge.constraints.py (rev 0) +++ trunk/blender/doc/python_api/examples/bge.constraints.py2011-07-08 06:51:12 UTC (rev 38217) @@ -0,0 +1,37 @@ +""" +Basic Physics Constraint +++ +Example of how to create a hinge Physics Constraint between two objects. +""" +from bge import logic +from bge import constraints + +# get object list +objects = logic.getCurrentScene().objects + +# get object named Object1 and Object 2 +object_1 = objects["Object1"] +object_2 = objects["Object2"] + +# want to use Edge constraint type +constraint_type = 2 + +# get Object1 and Object2 physics IDs +physics_id_1 = object_1.getPhysicsId() +physics_id_2 = object_2.getPhysicsId() + +# Use bottom right edge of Object1 for hinge position +edge_position_x = 1.0 +edge_position_y = 0.0 +edge_position_z = -1.0 + +# use Object1 y axis for angle to point hinge +edge_angle_x = 0.0 +edge_angle_y = 1.0 +edge_angle_z = 0.0 + +# create an edge constraint +constraints.createConstraint( physics_id_1, physics_id_2, + constraint_type, + edge_position_x, edge_position_y, edge_position_z, + edge_angle_x, edge_angle_y, edge_angle_z ) Property changes on: trunk/blender/doc/python_api/examples/bge.constraints.py ___ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/blender/doc/python_api/examples/bge.texture.1.py === --- trunk/blender/doc/python_api/examples/bge.texture.1.py 2011-07-08 06:16:17 UTC (rev 38216) +++ trunk/blender/doc/python_api/examples/bge.texture.1.py 2011-07-08 06:51:12 UTC (rev 38217) @@ -5,7 +5,6 @@ createTexture() and removeTexture() are to be called from a module Python Controller. """ -import bge from bge import logic from bge import texture @@ -14,7 +13,7 @@ object = cont.owner # get the reference pointer (ID) of the internal texture -ID = VT.materialID(obj, 'IMoriginal.png') +ID = texture.materialID(obj, 'IMoriginal.png') # create a texture object object_texture = texture.Texture(object, ID) Modified: trunk/blender/doc/python_api/examples/blf.py === --- trunk/blender/doc/python_api/examples/blf.py2011-07-08 06:16:17 UTC (rev 38216) +++ trunk/blender/doc/python_api/examples/blf.py2011-07-08 06:51:12 UTC (rev 38217) @@ -5,7 +5,6 @@ need to use the OpenGL wrapper :class:`~bgl` as well. """ # import game engine modules -import bge from bge import render from bge import logic # import stand alone modules Modified: trunk/blender/doc/python_api/rst/bge.events.rst === --- trunk/blender/doc/python_api/rst/bge.events.rst 2011-07-08 06:16:17 UTC (rev 38216) +++ trunk/blender/doc/python_api/rst/bge.events.rst 2011-07-08 06:51:12 UTC (rev 38217) @@ -1,5 +1,5 @@ -Game Engine bge.events module +Game Engine bge.events Module = * ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38495] trunk/blender/intern/ghost/intern/ GHOST_SystemX11.cpp: patch: [#27783] "Problem with clock" at 18:39: 00 by Daniel Dionne (mrzeon)
Revision: 38495 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38495 Author: dfelinto Date: 2011-07-18 22:28:42 + (Mon, 18 Jul 2011) Log Message: --- patch: [#27783] "Problem with clock" at 18:39:00 by Daniel Dionne (mrzeon) the overflow of the clock was causing crash in the game engine in Linux. (on June 11 2011, 18:39:00 GMT) running to the "where is waldo (wally)" bug award of 2011. Modified Paths: -- trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp Modified: trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp === --- trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp 2011-07-18 20:31:08 UTC (rev 38494) +++ trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp 2011-07-18 22:28:42 UTC (rev 38495) @@ -150,10 +150,11 @@ if (gettimeofday(&tv,NULL) == -1) { GHOST_ASSERT(false,"Could not instantiate timer!"); } - - m_start_time = GHOST_TUns64(tv.tv_sec*1000 + tv.tv_usec/1000); + // Taking care not to overflow the tv.tv_sec*1000 + m_start_time = GHOST_TUns64(tv.tv_sec)*1000 + tv.tv_usec/1000; + /* use detectable autorepeate, mac and windows also do this */ int use_xkb; int xkb_opcode, xkb_event, xkb_error; @@ -199,7 +200,8 @@ GHOST_ASSERT(false,"Could not compute time!"); } - return GHOST_TUns64(tv.tv_sec*1000 + tv.tv_usec/1000) - m_start_time; + // Taking care not to overflow the tv.tv_sec*1000 + return GHOST_TUns64(tv.tv_sec)*1000 + tv.tv_usec/1000 - m_start_time; } GHOST_TUns8 ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38501] trunk/blender/source/gameengine/ Converter/BL_BlenderDataConversion.cpp: bugfix: [#27348] blenderplayer showing a different viewport size in 2
Revision: 38501 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38501 Author: dfelinto Date: 2011-07-19 01:41:45 + (Tue, 19 Jul 2011) Log Message: --- bugfix: [#27348] blenderplayer showing a different viewport size in 2.57b I believe this bug was there since we (me) moved the game settings to scene->gm Since I was here I added support for x/y non square aspect pixels (i.e. anamorphic) we were already using it for videotexture so I don't know why we were not here. Tested in OSX, but it should be working in all OSs. Modified Paths: -- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp Modified: trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp === --- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2011-07-19 01:36:59 UTC (rev 38500) +++ trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2011-07-19 01:41:45 UTC (rev 38501) @@ -1976,8 +1976,8 @@ frame_type = RAS_FrameSettings::e_frame_scale; } - aspect_width = blenderscene->gm.xsch; - aspect_height = blenderscene->gm.ysch; + aspect_width = blenderscene->r.xsch*blenderscene->r.xasp; + aspect_height = blenderscene->r.ysch*blenderscene->r.yasp; } RAS_FrameSettings frame_settings( ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38502] trunk/blender/source/blender: cleanup of scene->gamedata DNA
Revision: 38502 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38502 Author: dfelinto Date: 2011-07-19 02:47:43 + (Tue, 19 Jul 2011) Log Message: --- cleanup of scene->gamedata DNA xsch and ysch were originally planed to replace the scene->r.xsch/r.ysch however in blender/3dview we still need to use the r. values. Therefore we can't really run from using those values even in bplayer. So removed the values in gamedata. The way it's now, render values (xsch and ysch) are responsible for aspect ratio and gamedata xplay and yplay are responsible for the size of the window. Modified Paths: -- trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/makesdna/DNA_scene_types.h Modified: trunk/blender/source/blender/blenloader/intern/readfile.c === --- trunk/blender/source/blender/blenloader/intern/readfile.c 2011-07-19 01:41:45 UTC (rev 38501) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2011-07-19 02:47:43 UTC (rev 38502) @@ -10281,8 +10281,6 @@ sce->gm.attrib = sce->r.attrib; //Stereo - sce->gm.xsch = sce->r.xsch; - sce->gm.ysch = sce->r.ysch; sce->gm.stereomode = sce->r.stereomode; /* reassigning stereomode NO_STEREO and DOME to a separeted flag*/ if (sce->gm.stereomode == 1){ //1 = STEREO_NOSTEREO Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h === --- trunk/blender/source/blender/makesdna/DNA_scene_types.h 2011-07-19 01:41:45 UTC (rev 38501) +++ trunk/blender/source/blender/makesdna/DNA_scene_types.h 2011-07-19 02:47:43 UTC (rev 38502) @@ -430,7 +430,8 @@ /* * Radius of the activity bubble, in Manhattan length. Objects * outside the box are activity-culled. */ - float activityBoxRadius; //it's not being used ANYWHERE !! + float activityBoxRadius; + /* * bit 3: (gameengine): Activity culling is enabled. * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling @@ -447,7 +448,8 @@ /* stereo/dome mode */ struct GameDome dome; - short stereoflag, stereomode, xsch, ysch; //xsch and ysch used for backwards compat. + short stereoflag, stereomode; + short pad2, pad3; float eyeseparation, pad1; } GameData; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38635] trunk/blender/source/blender/ editors/object/object_edit.c: bugfix: [#28026] Copy Game Property broken
Revision: 38635 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38635 Author: dfelinto Date: 2011-07-23 18:03:01 + (Sat, 23 Jul 2011) Log Message: --- bugfix: [#28026] Copy Game Property broken not exactly a bug, but the option to copy individual properties was not working from the SPACE menu. I believe this was happening because we are using dynamic enums. This commit makes the "merge" option to be the default one. So if you call it from the SPACE menu it will be the one used. Modified Paths: -- trunk/blender/source/blender/editors/object/object_edit.c Modified: trunk/blender/source/blender/editors/object/object_edit.c === --- trunk/blender/source/blender/editors/object/object_edit.c 2011-07-23 16:42:54 UTC (rev 38634) +++ trunk/blender/source/blender/editors/object/object_edit.c 2011-07-23 18:03:01 UTC (rev 38635) @@ -2162,16 +2162,20 @@ } CTX_DATA_END; } } - else if (ELEM(type, COPY_PROPERTIES_REPLACE, COPY_PROPERTIES_MERGE)) { + + else { CTX_DATA_BEGIN(C, Object*, ob_iter, selected_editable_objects) { if (ob != ob_iter) { if (ob->data != ob_iter->data){ - if (type == 2) {/* merge */ + if (type == COPY_PROPERTIES_REPLACE) + copy_properties( &ob_iter->prop, &ob->prop ); + + /* merge - the default when calling with no argument */ + else { for(prop = ob->prop.first; prop; prop= prop->next ) { set_ob_property(ob_iter, prop); } - } else /* replace */ - copy_properties( &ob_iter->prop, &ob->prop ); + } } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38696] trunk/blender/source/gameengine/ Ketsji/KX_KetsjiEngine.cpp: BGE BugFix for: [#23874] Custom projection matrix doesn't work in custom viewport
Revision: 38696 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38696 Author: dfelinto Date: 2011-07-25 15:37:55 + (Mon, 25 Jul 2011) Log Message: --- BGE BugFix for: [#23874] Custom projection matrix doesn't work in custom viewport This was never highly tested, that's why I never committed (my patch for this was from September 2010). But once again I got a report that this bug was a deal-break and the patch seems to work for this artist. I believe it's working, but I will keep my eyes open for this. Modified Paths: -- trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp Modified: trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp 2011-07-25 15:27:01 UTC (rev 38695) +++ trunk/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp 2011-07-25 15:37:55 UTC (rev 38696) @@ -1220,7 +1220,7 @@ projmat.setValue(m_overrideCamProjMat.getPointer()); cam->SetProjectionMatrix(projmat); } - } else if (cam->hasValidProjectionMatrix() && !cam->GetViewport() ) + } else if (cam->hasValidProjectionMatrix()) { m_rasterizer->SetProjectionMatrix(cam->GetProjectionMatrix()); } else ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38768] trunk/blender/source/blender/ blenkernel/intern/material.c: refix for #27912: crash after mesh.materials. pop() (fixed wrongly on rev.
Revision: 38768 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38768 Author: dfelinto Date: 2011-07-27 20:36:11 + (Wed, 27 Jul 2011) Log Message: --- refix for #27912: crash after mesh.materials.pop() (fixed wrongly on rev. 38299 - patch by Benoit Boilsee bug spotted while reviewing a patch. things are working now Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/material.c Modified: trunk/blender/source/blender/blenkernel/intern/material.c === --- trunk/blender/source/blender/blenkernel/intern/material.c 2011-07-27 19:37:33 UTC (rev 38767) +++ trunk/blender/source/blender/blenkernel/intern/material.c 2011-07-27 20:36:11 UTC (rev 38768) @@ -550,7 +550,7 @@ Material **mat; if(index + 1 != (*totcol)) - memmove((*matar), (*matar) + 1, sizeof(void *) * ((*totcol) - (index + 1))); + memmove((*matar)+index, (*matar)+(index+1), sizeof(void *) * ((*totcol) - (index + 1))); (*totcol)--; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38860] trunk/blender: patch [#27909] Added constants in bge.constraints by Solano Felicio (solano) + some changes in rst
Revision: 38860 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38860 Author: dfelinto Date: 2011-07-30 23:16:22 + (Sat, 30 Jul 2011) Log Message: --- patch [#27909] Added constants in bge.constraints by Solano Felicio (solano) + some changes in rst I named all the BGE modules with their actual names (e.g. Rasterizer, Video Texture, ...). so in the API index.html page they look more like the other Blender modules. I did the same for the bgl module. For bge.constraints this patch exposes the constants values for debug mode and createConstraints (they were hardcoded innts before). + making all the "todo" and #comments into rst comments (.. comments) Thanks Solano, it's great to get help to those tasks :) Modified Paths: -- trunk/blender/doc/python_api/rst/bge.constraints.rst trunk/blender/doc/python_api/rst/bge.events.rst trunk/blender/doc/python_api/rst/bge.logic.rst trunk/blender/doc/python_api/rst/bge.render.rst trunk/blender/doc/python_api/rst/bge.texture.rst trunk/blender/doc/python_api/rst/bge.types.rst trunk/blender/doc/python_api/rst/bgl.rst trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp Modified: trunk/blender/doc/python_api/rst/bge.constraints.rst === --- trunk/blender/doc/python_api/rst/bge.constraints.rst2011-07-30 19:09:34 UTC (rev 38859) +++ trunk/blender/doc/python_api/rst/bge.constraints.rst2011-07-30 23:16:22 UTC (rev 38860) @@ -1,29 +1,48 @@ -Game Engine bge.constraints Module +Physics Constraints (bge.constraints) == -.. note:: - This documentation is still very weak, and needs some help! +.. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag) -.. function:: createConstraint([obj1, [obj2, [restLength, [restitution, [damping]) - Creates a constraint. - :arg obj1: first object on Constraint - :type obj1: :class:'bge.types.KX_GameObject' #I think, there is no error when I use one + :arg physicsid: the physics id of the first object in constraint + :type physicsid: int - :arg obj2: second object on Constraint - :type obj2: :class:'bge.types.KX_GameObject' #too + :arg physicsid2: the physics id of the second object in constraint + :type physicsid2: int - :arg restLength: #to be filled - :type restLength: float + :arg constrainttype: the type of the constraint. The constraint types are: - :arg restitution: #to be filled - :type restitution: float + - :class:`POINTTOPOINT_CONSTRAINT` + - :class:`LINEHINGE_CONSTRAINT` + - :class:`ANGULAR_CONSTRAINT` + - :class:`CONETWIST_CONSTRAINT` + - :class:`VEHICLE_CONSTRAINT` - :arg damping: #to be filled - :type damping: float + :type constrainttype: int + :arg pivotX: pivot X position + :type pivotX: float + + :arg pivotY: pivot Y position + :type pivotY: float + + :arg pivotZ: pivot Z position + :type pivotZ: float + + :arg axisX: X axis + :type axisX: float + + :arg axisY: Y axis + :type axisY: float + + :arg axisZ: Z axis + :type axisZ: float + + :arg flag: .. to do + :type flag: int + .. attribute:: error Simbolic constant string that indicates error. @@ -49,7 +68,7 @@ :type constraintId: int :return: a vehicle constraint object. - :rtype: :class:'KX_VehicleWrapper' + :rtype: :class:`bge.types.KX_VehicleWrapper` .. function:: removeConstraint(constraintId) @@ -60,10 +79,10 @@ .. function:: setCcdMode(ccdMode) - ..note:: + .. note:: Very experimental, not recommended - Sets the CCD mode in the Physics Environment. + Sets the CCD (Continous Colision Detection) mode in the Physics Environment. :arg ccdMode: The new CCD mode. :type ccdMode: int @@ -73,21 +92,21 @@ .. note:: Reasonable default is 0.02 (if units are meters) - Sets the contact breaking treshold in the Physics Environment. + Sets tresholds to do with contact point management. :arg breakingTreshold: The new contact breaking treshold. :type breakingTreshold: float .. function:: setDeactivationAngularTreshold(angularTreshold) - Sets the deactivation angular treshold. + Sets the angular velocity treshold. :arg angularTreshold: New deactivation angular treshold. :type angularTreshold: float .. function:: setDeactivationLinearTreshold(linearTreshold) - Sets the deactivation linear treshold. + Sets the linear velocity treshold. :arg linearTreshold: New deactivation linear treshold. :type linearTreshold: float @@ -104,21 +123,20 @@ Sets the debug mode. Debug modes: - - No debug: 0 - - Draw wireframe: 1 - - Draw Aabb: 2 #What's Aabb? - - Draw freatures text: 4 - - Draw contact points: 8 - - No deactivation: 16 - - No help text:
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38879] trunk/blender/source/blender: bugfix [#28111] material.pop breaks mt->mat_nr
Revision: 38879 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38879 Author: dfelinto Date: 2011-07-31 11:12:38 + (Sun, 31 Jul 2011) Log Message: --- bugfix [#28111] material.pop breaks mt->mat_nr create a new parameter for materials.pop() to not remove material slot. this way the mat_nr is still the old one. for the default behaviour we now have material remapping (i.e. data_delete_material_index_id(id, index)). This new function is brought from the material_slot remove function. Modified Paths: -- trunk/blender/source/blender/blenkernel/BKE_material.h trunk/blender/source/blender/blenkernel/intern/material.c trunk/blender/source/blender/blenkernel/intern/mesh.c trunk/blender/source/blender/makesrna/intern/rna_ID.c Modified: trunk/blender/source/blender/blenkernel/BKE_material.h === --- trunk/blender/source/blender/blenkernel/BKE_material.h 2011-07-31 10:54:51 UTC (rev 38878) +++ trunk/blender/source/blender/blenkernel/BKE_material.h 2011-07-31 11:12:38 UTC (rev 38879) @@ -78,7 +78,7 @@ /* rna api */ void material_append_id(struct ID *id, struct Material *ma); -struct Material *material_pop_id(struct ID *id, int index); +struct Material *material_pop_id(struct ID *id, int index, int remove_material_slot); /* rendering */ Modified: trunk/blender/source/blender/blenkernel/intern/material.c === --- trunk/blender/source/blender/blenkernel/intern/material.c 2011-07-31 10:54:51 UTC (rev 38878) +++ trunk/blender/source/blender/blenkernel/intern/material.c 2011-07-31 11:12:38 UTC (rev 38879) @@ -61,8 +61,8 @@ #include "BKE_material.h" #include "BKE_mesh.h" #include "BKE_node.h" +#include "BKE_curve.h" - #include "GPU_material.h" /* used in UI and render */ @@ -515,6 +515,37 @@ return NULL; } +void data_delete_material_index_id(ID *id, int index) +{ + Mesh *me; + Curve *cu; + Nurb *nu; + int curvetype; + + switch(GS(id->name)) { + case ID_ME: + me=(Mesh *)id; + mesh_delete_material_index(me, index); + break; + case ID_CU: + cu= (Curve *)id; + nu= cu->nurb.first; + + curvetype=curve_type(cu); + if (!ELEM(curvetype, OB_CURVE, OB_SURF)) + return; + + while (nu) { + if(nu->mat_nr && nu->mat_nr>=index) { + nu->mat_nr--; + if (curvetype == OB_CURVE) nu->charidx--; + } + nu= nu->next; + } + break; + } +} + void material_append_id(ID *id, Material *ma) { Material ***matar; @@ -532,7 +563,7 @@ } } -Material *material_pop_id(ID *id, int index) +Material *material_pop_id(ID *id, int index, int remove_material_slot) { Material *ret= NULL; Material ***matar; @@ -540,27 +571,36 @@ short *totcol= give_totcolp_id(id); if(index >= 0 && index < (*totcol)) { ret= (*matar)[index]; - id_us_min((ID *)ret); - if(*totcol <= 1) { - *totcol= 0; - MEM_freeN(*matar); - *matar= NULL; - } - else { - Material **mat; + id_us_min((ID *)ret); - if(index + 1 != (*totcol)) - memmove((*matar)+index, (*matar)+(index+1), sizeof(void *) * ((*totcol) - (index + 1))); + if (remove_material_slot) { + if(*totcol <= 1) { + *totcol= 0; + MEM_freeN(*matar); + *matar= NULL; + } + else { + Material **mat; + if(index + 1 != (*totcol)) + memmove((*matar)+index, (*matar)+(index+1), sizeof(void *) * ((*totcol) - (index + 1))); - (*totcol)--; - - mat= MEM_callocN(sizeof(void *) * (*totcol), "newmatar"); - memcpy(mat, *matar, sizeof(void *) * (*totcol)); - MEM_freeN(*matar); + (*totcol)--; + + mat= MEM_callocN(sizeof(void *) * (*totcol), "newmatar
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38880] trunk/blender/source/gameengine/ Ketsji/KX_PyConstraintBinding.cpp: reverting part of #38876 ( whitespace edits)
Revision: 38880 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38880 Author: dfelinto Date: 2011-07-31 11:21:48 + (Sun, 31 Jul 2011) Log Message: --- reverting part of #38876 (whitespace edits) the new if/else nesting introduced in the previous commit makes no sense. (since I was here I add a comment for extrainfo and did some small cleanup) Modified Paths: -- trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp Modified: trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp === --- trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp 2011-07-31 11:12:38 UTC (rev 38879) +++ trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp 2011-07-31 11:21:48 UTC (rev 38880) @@ -429,46 +429,46 @@ success = PyArg_ParseTuple(args,"lli",&physicsid,&physicsid2,&constrainttype); #endif } - else { - if (len ==6) { + else if (len == 6) + { #if defined(_WIN64) - success = PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ); + success = PyArg_ParseTuple(args,"LLifff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ); #else - success = PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ); + success = PyArg_ParseTuple(args,"llifff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ); #endif - } - else if (len == 9) - { + } + else if (len == 9) + { #if defined(_WIN64) - success = PyArg_ParseTuple(args,"LLiff",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); + success = PyArg_ParseTuple(args,"LLiff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); #else - success = PyArg_ParseTuple(args,"lliff",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); + success = PyArg_ParseTuple(args,"lliff",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ); #endif - - } - else if (len == 10) - { + } + else if (len == 10) + { #if defined(_WIN64) - success = PyArg_ParseTuple(args,"LLiffi",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); + success = PyArg_ParseTuple(args,"LLiffi",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); #else - success = PyArg_ParseTuple(args,"lliffi",&physicsid,&physicsid2,&constrainttype, - &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); + success = PyArg_ParseTuple(args,"lliffi",&physicsid,&physicsid2,&constrainttype, + &pivotX,&pivotY,&pivotZ,&axisX,&axisY,&axisZ,&flag); #endif - } - else if (len==4) - { + } + + /* XXX extrainfo seems to be nothing implemented. right now it works as a pivot with [X,0,0] */ + else if (len == 4) + { #if defined(_WIN64) - success = PyArg_ParseTuple(args,"LLii",&physicsid,&physicsid2,&constrainttype,&extrainfo); + success = PyArg_ParseTuple(args,"LLii",&physicsid,&physicsid2,&constrainttype,&extrainfo); #else - success = PyArg_ParseTuple(args,"llii",&physicsid,&physicsid2,&constrainttype,&extrainfo); + success = PyArg_ParseTuple(args,"llii",&physicsid,&physicsid2,&constrainttype,&extrainfo); #endif - pivotX=extrainfo; - } + pivotX=extrainfo; } if (success) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39014] trunk/blender/doc/python_api/rst: rst API doc fixes: literalincluding bge.texture and bge. constraints examples + bgl fixes
Revision: 39014 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39014 Author: dfelinto Date: 2011-08-04 09:47:40 + (Thu, 04 Aug 2011) Log Message: --- rst API doc fixes: literalincluding bge.texture and bge.constraints examples + bgl fixes Modified Paths: -- trunk/blender/doc/python_api/rst/bge.constraints.rst trunk/blender/doc/python_api/rst/bge.texture.rst trunk/blender/doc/python_api/rst/bgl.rst Modified: trunk/blender/doc/python_api/rst/bge.constraints.rst === --- trunk/blender/doc/python_api/rst/bge.constraints.rst2011-08-04 09:47:09 UTC (rev 39013) +++ trunk/blender/doc/python_api/rst/bge.constraints.rst2011-08-04 09:47:40 UTC (rev 39014) @@ -2,6 +2,10 @@ Physics Constraints (bge.constraints) = +.. module:: bge.constraints + +.. literalinclude:: ../examples/bge.constraints.py + .. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag) Creates a constraint. Modified: trunk/blender/doc/python_api/rst/bge.texture.rst === --- trunk/blender/doc/python_api/rst/bge.texture.rst2011-08-04 09:47:09 UTC (rev 39013) +++ trunk/blender/doc/python_api/rst/bge.texture.rst2011-08-04 09:47:40 UTC (rev 39014) @@ -36,6 +36,10 @@ .. module:: bge.texture +.. literalinclude:: ../examples/bge.texture.py + +.. literalinclude:: ../examples/bge.texture.1.py + .. class:: VideoFFmpeg(file [, capture=-1, rate=25.0, width=0, height=0]) FFmpeg video source Modified: trunk/blender/doc/python_api/rst/bgl.rst === --- trunk/blender/doc/python_api/rst/bgl.rst2011-08-04 09:47:09 UTC (rev 39013) +++ trunk/blender/doc/python_api/rst/bgl.rst2011-08-04 09:47:40 UTC (rev 39014) @@ -15,7 +15,7 @@ The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning OpenGL}" and the online NeHe tutorials are two of the best resources. -..note:: +.. note:: You can use the :class:`Image` type to load and set textures. See :class:`Image.gl_load` and :class:`Image.gl_load`, for example. @@ -1386,7 +1386,7 @@ bgl.glGetFloatv(bgl.GL_MODELVIEW_MATRIX, view_matrix) f = 1.0 / view_matrix[0] - # Instead of the usual glRasterPos2i(xval, yval) +# Instead of the usual glRasterPos2i(xval, yval) bgl.glRasterPos2f(xval * f, yval * f) @@ -1848,10 +1848,13 @@ .. code-block:: python import bgl + myByteBuffer = bgl.Buffer(bgl.GL_BYTE, [32, 32]) bgl.glGetPolygonStipple(myByteBuffer) + print(myByteBuffer.dimensions) print(myByteBuffer.to_list()) + sliceBuffer = myByteBuffer[0:16] print(sliceBuffer) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ad1c3be] master: Small API typo found while reading the API
Commit: ad1c3bef8bb0b405d22bfed8007629276cb0d68f Author: Dalai Felinto Date: Tue May 31 12:39:58 2016 -0300 Branches: master https://developer.blender.org/rBad1c3bef8bb0b405d22bfed8007629276cb0d68f Small API typo found while reading the API === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 7cc6983..b665561 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -698,7 +698,7 @@ void RNA_api_object(StructRNA *srna) #endif /* NDEBUG */ func = RNA_def_function(srna, "update_from_editmode", "rna_Object_update_from_editmode"); - RNA_def_function_ui_description(func, "Load the objects edit-mode data intp the object data"); + RNA_def_function_ui_description(func, "Load the objects edit-mode data into the object data"); parm = RNA_def_boolean(func, "result", 0, "", "Success"); RNA_def_function_return(func, parm); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d852715] master: Increase range of Font object textboxs
Commit: d85271572b4d4c558f756d91e48df281808e84ab Author: Dalai Felinto Date: Tue May 31 19:06:13 2016 -0300 Branches: master https://developer.blender.org/rBd85271572b4d4c558f756d91e48df281808e84ab Increase range of Font object textboxs The current values were arbitrary. I'm keeping them as ui_range, but internally there is no reason we can't use larger values. === M source/blender/makesrna/intern/rna_curve.c === diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index d28dd8f..cb7a40a 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1009,13 +1009,15 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); @@ -1117,25 +1119,29 @@ static void rna_def_textbox(BlenderRNA *brna) /* number values */ prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "x"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox X Offset", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "y"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Y Offset", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "w"); - RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Width", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "h"); - RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Height", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1d3cb0e] compositor-2016: Increase range of Font object textboxs
Commit: 1d3cb0e549667c59db7c5d830c086c803679ab7d Author: Dalai Felinto Date: Tue May 31 19:06:13 2016 -0300 Branches: compositor-2016 https://developer.blender.org/rB1d3cb0e549667c59db7c5d830c086c803679ab7d Increase range of Font object textboxs The current values were arbitrary. I'm keeping them as ui_range, but internally there is no reason we can't use larger values. === M source/blender/makesrna/intern/rna_curve.c === diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index d28dd8f..cb7a40a 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1009,13 +1009,15 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); @@ -1117,25 +1119,29 @@ static void rna_def_textbox(BlenderRNA *brna) /* number values */ prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "x"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox X Offset", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "y"); - RNA_def_property_range(prop, -50.0f, 50.0f); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Y Offset", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "w"); - RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Width", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "h"); - RNA_def_property_range(prop, 0.0f, 50.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3); RNA_def_property_ui_text(prop, "Textbox Height", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dbc46cb] compositor-2016: Small API typo found while reading the API
Commit: dbc46cbfe952c40635ecdcb0ea5f185c5ae71889 Author: Dalai Felinto Date: Tue May 31 12:39:58 2016 -0300 Branches: compositor-2016 https://developer.blender.org/rBdbc46cbfe952c40635ecdcb0ea5f185c5ae71889 Small API typo found while reading the API === M source/blender/makesrna/intern/rna_object_api.c === diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 7cc6983..b665561 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -698,7 +698,7 @@ void RNA_api_object(StructRNA *srna) #endif /* NDEBUG */ func = RNA_def_function(srna, "update_from_editmode", "rna_Object_update_from_editmode"); - RNA_def_function_ui_description(func, "Load the objects edit-mode data intp the object data"); + RNA_def_function_ui_description(func, "Load the objects edit-mode data into the object data"); parm = RNA_def_boolean(func, "result", 0, "", "Success"); RNA_def_function_return(func, parm); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e0db647] master: Fix region_2d_to_origin_3d not working with ortho view
Commit: e0db647d35cd10675f8ab529f0f5f8e26680973b Author: Dalai Felinto Date: Tue Jun 14 17:59:25 2016 -0300 Branches: master https://developer.blender.org/rBe0db647d35cd10675f8ab529f0f5f8e26680973b Fix region_2d_to_origin_3d not working with ortho view In some cases when: * the viewport was in the camera mode * the camera was ortho * the view was not fitting (as oppose to use HOME) region_2d_to_origin_3d would misbehave (and consequently region_2d_to_location_3d). Sample addon to test it: ``` import bpy from bpy_extras.view3d_utils import ( region_2d_to_location_3d, ) from mathutils import ( Vector, ) class MoveXYOperator(bpy.types.Operator): """Translate the view using mouse events""" bl_idname = "view3d.move_xy" bl_label = "Move XY" @classmethod def poll(cls, context): return context.object def modal(self, context, event): if event.type == 'MOUSEMOVE': self.move(context, event) elif event.type in {'LEFTMOUSE', 'RIGHTMOUSE', 'ESC'}: return {'FINISHED'} return {'RUNNING_MODAL'} def invoke(self, context, event): if context.space_data.type == 'VIEW_3D': self.ob = context.object context.window_manager.modal_handler_add(self) return {'RUNNING_MODAL'} else: self.report({'WARNING'}, "Active space must be a View3d") return {'CANCELLED'} def move(self, context, event): xy = region_2d_to_location_3d( context.region, context.space_data.region_3d, (event.mouse_region_x, event.mouse_region_y), Vector(), ).xy self.ob.location.xy = xy def register(): bpy.utils.register_class(MoveXYOperator) def unregister(): bpy.utils.unregister_class(MoveXYOperator) if __name__ == "__main__": register() ``` === M release/scripts/modules/bpy_extras/view3d_utils.py === diff --git a/release/scripts/modules/bpy_extras/view3d_utils.py b/release/scripts/modules/bpy_extras/view3d_utils.py index 4aa0626..5f83cdc 100644 --- a/release/scripts/modules/bpy_extras/view3d_utils.py +++ b/release/scripts/modules/bpy_extras/view3d_utils.py @@ -101,7 +101,7 @@ def region_2d_to_origin_3d(region, rv3d, coord, clamp=None): persinv = persmat.inverted() origin_start = ((persinv.col[0].xyz * dx) + (persinv.col[1].xyz * dy) + -viewinv.translation) +persinv.translation) if clamp != 0.0: if rv3d.view_perspective != 'CAMERA': ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [72273b0] master: Fix building for Windows after 57cff46v (booleans unitialized)
Commit: 72273b08cc21467f207cf61243c979cc47b790c5 Author: Dalai Felinto Date: Mon Jun 20 13:02:53 2016 -0300 Branches: master https://developer.blender.org/rB72273b08cc21467f207cf61243c979cc47b790c5 Fix building for Windows after 57cff46v (booleans unitialized) === M source/blender/bmesh/tools/bmesh_decimate_collapse.c === diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c index 1c8be09..acb220b 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c +++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c @@ -542,8 +542,8 @@ static bool bm_decim_triangulate_begin(BMesh *bm, int *r_edges_tri_tot) { BMIter iter; BMFace *f; - bool has_quad; - bool has_ngon; + bool has_quad = false; + bool has_ngon = false; bool has_cut = false; BLI_assert((bm->elem_index_dirty & BM_VERT) == 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cb5a772] master: Text Object: Vertical Alignment
Commit: cb5a77253a719c08986aa69a3d3f7fc8725648c7 Author: Dalai Felinto Date: Mon Jun 20 23:21:24 2016 -0300 Branches: master https://developer.blender.org/rBcb5a77253a719c08986aa69a3d3f7fc8725648c7 Text Object: Vertical Alignment A new option for Font/Text objects vertical alignment: * Top Base-Line (current mode) * Top * Center * Bottom The Top is the equivalent as the Top-Baseline with an empty line at the begin of the text. It's nice to have this option too though, since if we are driving the alignment via Python we don't want to add extra lines to the text only to accomodate to the desired vertical alignment. The Center and Bottom are as intuitive as their name suggest. When working with text boxes, the vertical alignment only work for paragraphs that are not vertically full. Many thanks to Campbell Barton (ideasman42 / @campbellbarton) for the code review, code comments, and overall suggestions and changes :) Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D2061 === M release/scripts/startup/bl_ui/properties_data_curve.py M source/blender/blenkernel/intern/font.c M source/blender/editors/object/object_edit.c M source/blender/makesdna/DNA_curve_types.h M source/blender/makesrna/intern/rna_curve.c === diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 81ecd2e..af8431b 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -370,8 +370,11 @@ class DATA_PT_paragraph(CurveButtonsPanelText, Panel): text = context.curve -layout.label(text="Align:") -layout.prop(text, "align", expand=True) +layout.label(text="Horizontal Alignment:") +layout.prop(text, "align_x", expand=True) + +layout.label(text="Vertical Alignment:") +layout.prop(text, "align_y", expand=True) split = layout.split() diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 9875740..b408893 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -628,6 +628,8 @@ bool BKE_vfont_to_curve_ex(Main *bmain, Object *ob, int mode, ListBase *r_nubase bool use_textbox; VChar *che; struct CharTrans *chartransdata = NULL, *ct; + /* Text at the beginning of the last used text-box (use for y-axis alignment). */ + int i_textbox = 0; struct TempLineInfo *lineinfo; float *f, xof, yof, xtrax, linedist; float twidth, maxlen = 0; @@ -830,6 +832,7 @@ makebreak: (cu->totbox > (curbox + 1)) && ((-(yof - tb_scale.y)) > (tb_scale.h - linedist) - yof_scale)) { + i_textbox = i + 1; maxlen = 0; curbox++; @@ -983,6 +986,60 @@ makebreak: } } + /* top-baseline is default, in this case, do nothing */ + if (cu->align_y != CU_ALIGN_Y_TOP_BASELINE) { + if (tb_scale.h != 0.0f) { + /* top and top-baseline are the same when text-boxes are used */ + if (cu->align_y != CU_ALIGN_Y_TOP && i_textbox < slen) { + /* all previous textboxes are 'full', only align the last used text-box */ + float yoff; + int lines; + struct CharTrans *ct_last, *ct_textbox; + + ct_last = chartransdata + slen - 1; + ct_textbox = chartransdata + i_textbox; + + lines = ct_last->linenr - ct_textbox->linenr + 1; + if (mem[slen - 1] == '\n') { + lines++; + } + + if (cu->align_y == CU_ALIGN_Y_BOTTOM) { + yoff = (lines * linedist) - tb_scale.h; + } + else if (cu->align_y == CU_ALIGN_Y_CENTER) { + yoff = 0.5f * ((lines * linedist) - tb_scale.h); + } + + ct = ct_textbox; + for (i = i_textbox - 1; i < slen; i++) { + ct->yof += yoff; + ct++; + } +
[Bf-blender-cvs] [1640796] master: Fix Python API error message (do_unlink, instead of unlink)
Commit: 1640796cccfee619feccd8a8cc556215996e962a Author: Dalai Felinto Date: Wed Jul 6 11:32:46 2016 -0300 Branches: master https://developer.blender.org/rB1640796cccfee619feccd8a8cc556215996e962a Fix Python API error message (do_unlink, instead of unlink) === M source/blender/makesrna/intern/rna_main_api.c === diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index c0a0bc0..334ba06 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -129,7 +129,7 @@ static void rna_Main_ID_remove(Main *bmain, ReportList *reports, PointerRNA *id_ } else { BKE_reportf(reports, RPT_ERROR, - "%s '%s' must have zero users to be removed, found %d (try with unlink=True parameter)", + "%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)", BKE_idcode_to_name(GS(id->name)), id->name + 2, ID_REAL_USERS(id)); } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fde88ad9d2f] master: Fix T66627: Multiobject Edit UV constraint to image bounds
Commit: fde88ad9d2fc93caa6c3cc39d4c009a0c9bac7c5 Author: Dalai Felinto Date: Tue Jul 9 20:07:08 2019 -0300 Branches: master https://developer.blender.org/rBfde88ad9d2fc93caa6c3cc39d4c009a0c9bac7c5 Fix T66627: Multiobject Edit UV constraint to image bounds This was broken since the original commit to handle multi-object editing: rBbfc9d426bb95. === M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 1b5ac66644d..27a2ab85127 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3710,50 +3710,48 @@ bool clipUVTransform(TransInfo *t, float vec[2], const bool resize) for (a = 0, td = tc->data; a < tc->data_len; a++, td++) { minmax_v2v2_v2(min, max, td->loc); } + } -if (resize) { - if (min[0] < 0.0f && t->center_global[0] > 0.0f && - t->center_global[0] < t->aspect[0] * 0.5f) { -vec[0] *= t->center_global[0] / (t->center_global[0] - min[0]); - } - else if (max[0] > t->aspect[0] && t->center_global[0] < t->aspect[0]) { -vec[0] *= (t->center_global[0] - t->aspect[0]) / (t->center_global[0] - max[0]); - } - else { -clipx = 0; - } + if (resize) { +if (min[0] < 0.0f && t->center_global[0] > 0.0f && t->center_global[0] < t->aspect[0] * 0.5f) { + vec[0] *= t->center_global[0] / (t->center_global[0] - min[0]); +} +else if (max[0] > t->aspect[0] && t->center_global[0] < t->aspect[0]) { + vec[0] *= (t->center_global[0] - t->aspect[0]) / (t->center_global[0] - max[0]); +} +else { + clipx = 0; +} - if (min[1] < 0.0f && t->center_global[1] > 0.0f && - t->center_global[1] < t->aspect[1] * 0.5f) { -vec[1] *= t->center_global[1] / (t->center_global[1] - min[1]); - } - else if (max[1] > t->aspect[1] && t->center_global[1] < t->aspect[1]) { -vec[1] *= (t->center_global[1] - t->aspect[1]) / (t->center_global[1] - max[1]); - } - else { -clipy = 0; - } +if (min[1] < 0.0f && t->center_global[1] > 0.0f && t->center_global[1] < t->aspect[1] * 0.5f) { + vec[1] *= t->center_global[1] / (t->center_global[1] - min[1]); +} +else if (max[1] > t->aspect[1] && t->center_global[1] < t->aspect[1]) { + vec[1] *= (t->center_global[1] - t->aspect[1]) / (t->center_global[1] - max[1]); } else { - if (min[0] < 0.0f) { -vec[0] -= min[0]; - } - else if (max[0] > t->aspect[0]) { -vec[0] -= max[0] - t->aspect[0]; - } - else { -clipx = 0; - } + clipy = 0; +} + } + else { +if (min[0] < 0.0f) { + vec[0] -= min[0]; +} +else if (max[0] > t->aspect[0]) { + vec[0] -= max[0] - t->aspect[0]; +} +else { + clipx = 0; +} - if (min[1] < 0.0f) { -vec[1] -= min[1]; - } - else if (max[1] > t->aspect[1]) { -vec[1] -= max[1] - t->aspect[1]; - } - else { -clipy = 0; - } +if (min[1] < 0.0f) { + vec[1] -= min[1]; +} +else if (max[1] > t->aspect[1]) { + vec[1] -= max[1] - t->aspect[1]; +} +else { + clipy = 0; } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d3e1782abc3] master: Fix T66530: set_stereo_3d (pageflip) exists Blender
Commit: d3e1782abc3be15fdc45e5139ebe1e9638d52734 Author: Dalai Felinto Date: Tue Jul 9 15:50:45 2019 -0300 Branches: master https://developer.blender.org/rBd3e1782abc3be15fdc45e5139ebe1e9638d52734 Fix T66530: set_stereo_3d (pageflip) exists Blender Note: Although this fixes the issue (as in, it prevents a crash) BKE_reports are not working because of CTX_wm_window_set(). Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D5210 === M source/blender/windowmanager/intern/wm_window.c === diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index daa501f55b4..d17b8817691 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -714,8 +714,14 @@ void wm_window_ghostwindows_ensure(wmWindowManager *wm) wm_window_ghostwindow_add(wm, "Blender", win); } -/* happens after fileread */ -wm_window_ensure_eventstate(win); + +if (win->ghostwin != NULL) { + /* If we have no ghostwin this is a buggy window that should be removed. + * However we still need to initialize it correctly so the screen doesn't hang. */ + + /* happens after fileread */ + wm_window_ensure_eventstate(win); +} /* add keymap handlers (1 handler for all keys in map!) */ keymap = WM_keymap_ensure(wm->defaultconf, "Window", 0, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [5ca302cb0cb] master: Fix T67078: Crash with vertex slide and multi-objects
Commit: 5ca302cb0cb40506e1f8a5f22e9baa3738ab4a58 Author: Dalai Felinto Date: Tue Jul 16 22:23:43 2019 -0300 Branches: master https://developer.blender.org/rB5ca302cb0cb40506e1f8a5f22e9baa3738ab4a58 Fix T67078: Crash with vertex slide and multi-objects If one of the objects had invalid selected edges, it would lead to a crash since none of the for loops were checking for whether the edge slide data is valid. We could refactor the macros to create a new FOREACH_TRANS_DATA_CONTAINER_WITH_DATA However we are too close to 2.80 final release so we manually skip them for now. Note: TRANS_DATA_CONTAINER_FIRST_OK cannot be used either for the same reason. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D5274 === M source/blender/editors/transform/transform.c M source/blender/editors/transform/transform_conversions.c === diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 7c4f9f1d95b..1a904daafc3 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -6703,9 +6703,28 @@ static void slide_origdata_free_date(SlideOrigData *sod) /** \name Transform Edge Slide * \{ */ +/** + * Get the first valid EdgeSlideData. + * + * Note we cannot trust TRANS_DATA_CONTAINER_FIRST_OK because of multi-object that + * may leave items with invalid custom data in the transform data container. + */ +static EdgeSlideData *edgeSlideFirstGet(TransInfo *t) +{ + FOREACH_TRANS_DATA_CONTAINER (t, tc) { +EdgeSlideData *sld = tc->custom.mode.data; +if (sld == NULL) { + continue; +} +return sld; + } + BLI_assert(!"Should never happen, at least one EdgeSlideData should be valid"); + return NULL; +} + static void calcEdgeSlideCustomPoints(struct TransInfo *t) { - EdgeSlideData *sld = TRANS_DATA_CONTAINER_FIRST_OK(t)->custom.mode.data; + EdgeSlideData *sld = edgeSlideFirstGet(t); setCustomPoints(t, &t->mouse, sld->mval_end, sld->mval_start); @@ -7679,8 +7698,12 @@ void projectEdgeSlideData(TransInfo *t, bool is_final) { FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; -SlideOrigData *sod = &sld->orig_data; +if (sld == NULL) { + continue; +} + +SlideOrigData *sod = &sld->orig_data; if (sod->use_origfaces == false) { return; } @@ -7705,7 +7728,7 @@ void freeEdgeSlideVerts(TransInfo *UNUSED(t), { EdgeSlideData *sld = custom_data->data; - if (!sld) { + if (sld == NULL) { return; } @@ -7847,9 +7870,9 @@ static eRedrawFlag handleEventEdgeSlide(struct TransInfo *t, const struct wmEven static void drawEdgeSlide(TransInfo *t) { - if ((t->mode == TFM_EDGE_SLIDE) && TRANS_DATA_CONTAINER_FIRST_OK(t)->custom.mode.data) { + if ((t->mode == TFM_EDGE_SLIDE) && edgeSlideFirstGet(t)) { const EdgeSlideParams *slp = t->custom.mode.data; -EdgeSlideData *sld = TRANS_DATA_CONTAINER_FIRST_OK(t)->custom.mode.data; +EdgeSlideData *sld = edgeSlideFirstGet(t); const bool is_clamp = !(t->flag & T_ALT_TRANSFORM); /* Even mode */ @@ -7968,7 +7991,7 @@ static void drawEdgeSlide(TransInfo *t) static void doEdgeSlide(TransInfo *t, float perc) { EdgeSlideParams *slp = t->custom.mode.data; - EdgeSlideData *sld_active = TRANS_DATA_CONTAINER_FIRST_OK(t)->custom.mode.data; + EdgeSlideData *sld_active = edgeSlideFirstGet(t); slp->perc = perc; @@ -7979,6 +8002,11 @@ static void doEdgeSlide(TransInfo *t, float perc) const float perc_final = fabsf(perc); FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; + +if (sld == NULL) { + continue; +} + TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++) { madd_v3_v3v3fl(sv->v->co, sv->v_co_orig, sv->dir_side[side_index], perc_final); @@ -7992,6 +8020,11 @@ static void doEdgeSlide(TransInfo *t, float perc) const int side_index = sld_active->curr_side_unclamp; FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; + +if (sld == NULL) { + continue; +} + TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++) { float dir_flip[3]; @@ -8028,6 +8061,11 @@ static void doEdgeSlide(TransInfo *t, float perc) FOREACH_TRANS_DATA_CONTAINER (t, tc) { EdgeSlideData *sld = tc->custom.mode.data; + + if (sld == NULL) { +continue; + } + TransDataEdgeSlideVert *sv = sld->sv; for (int i = 0; i < sld->totsv; i++, sv++)
[Bf-blender-cvs] [d90201aee21] master: Edge Slide: Fix multi-object for loop early exit
Commit: d90201aee219b729cb60d4078c104f708f495be8 Author: Dalai Felinto Date: Tue Jul 16 22:52:37 2019 -0300 Branches: master https://developer.blender.org/rBd90201aee219b729cb60d4078c104f708f495be8 Edge Slide: Fix multi-object for loop early exit Part of D5274, reviewed by Campbell Barton. === M source/blender/editors/transform/transform.c === diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1a904daafc3..a316567fc63 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -7705,7 +7705,7 @@ void projectEdgeSlideData(TransInfo *t, bool is_final) SlideOrigData *sod = &sld->orig_data; if (sod->use_origfaces == false) { - return; + continue; } slide_origdata_interp_data(tc->obedit, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bfa6cb3a7d9] master: Fix T64312: Selection inconsistencies when switching collections
Commit: bfa6cb3a7d9a867d4f664e169ab8b65e2bd2142b Author: Dalai Felinto Date: Fri Jul 12 12:51:54 2019 -0300 Branches: master https://developer.blender.org/rBbfa6cb3a7d9a867d4f664e169ab8b65e2bd2142b Fix T64312: Selection inconsistencies when switching collections Basically layer_collection_sync was calling BKE_base_eval_flags right away while iterating over the bases. However when a parent/sibling collection is to influence the collection flag of an object that exists in more than one collection, it is too late since we deselect the object in BKE_base_eval_flags right away. Related to T64312. Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D5243 === M source/blender/blenkernel/intern/layer.c === diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 2b064c6b2a7..7dc04214ba5 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -745,9 +745,6 @@ static short layer_collection_sync(ViewLayer *view_layer, } lc->runtime_flag |= LAYER_COLLECTION_HAS_OBJECTS; - - /* Make sure flags on base are usable right away. */ - BKE_base_eval_flags(base); } runtime_flag |= lc->runtime_flag; @@ -814,6 +811,10 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) BLI_freelistN(&view_layer->object_bases); view_layer->object_bases = new_object_bases; + for (Base *base = view_layer->object_bases.first; base; base = base->next) { +BKE_base_eval_flags(base); + } + /* Always set a valid active collection. */ LayerCollection *active = view_layer->active_collection; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a6b7ee2a1e8] master: Fix T66948: Outliner - collections/objects with wrong active state
Commit: a6b7ee2a1e8f4631b14293aedcef1e981a56dc8a Author: Dalai Felinto Date: Tue Jul 16 18:05:43 2019 -0300 Branches: master https://developer.blender.org/rBa6b7ee2a1e8f4631b14293aedcef1e981a56dc8a Fix T66948: Outliner - collections/objects with wrong active state If the parent collection was out of view we were not taking its properties into consideration. We need it even when not drawing the parent to set active/inactive values for its children. Related Task: T66948 Reviewers: brecht Subscribers: Zachman Differential Revision: https://developer.blender.org/D5272 === M source/blender/editors/space_outliner/outliner_draw.c === diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 31783e09aeb..55130ae8894 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -933,6 +933,40 @@ static void outliner_restrict_properties_enable_layer_collection_set( } } +static bool outliner_restrict_properties_collection_set(Scene *scene, +TreeElement *te, +PointerRNA *collection_ptr, +PointerRNA *layer_collection_ptr, +RestrictProperties *props, + RestrictPropertiesActive *props_active) +{ + TreeStoreElem *tselem = TREESTORE(te); + LayerCollection *layer_collection = (tselem->type == TSE_LAYER_COLLECTION) ? te->directdata : + NULL; + Collection *collection = outliner_collection_from_tree_element(te); + + if ((collection->flag & COLLECTION_IS_MASTER) || + (layer_collection && ((layer_collection->flag & LAYER_COLLECTION_EXCLUDE) != 0))) { +return false; + } + + /* Create the PointerRNA. */ + RNA_id_pointer_create(&collection->id, collection_ptr); + if (layer_collection != NULL) { +RNA_pointer_create(&scene->id, &RNA_LayerCollection, layer_collection, layer_collection_ptr); + } + + /* Update the restriction column values for the collection children. */ + if (layer_collection) { +outliner_restrict_properties_enable_layer_collection_set( +layer_collection_ptr, collection_ptr, props, props_active); + } + else { +outliner_restrict_properties_enable_collection_set(collection_ptr, props, props_active); + } + return true; +} + static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ViewLayer *view_layer, @@ -1337,30 +1371,16 @@ static void outliner_draw_restrictbuts(uiBlock *block, } } else if (outliner_is_collection_tree_element(te)) { -LayerCollection *layer_collection = (tselem->type == TSE_LAYER_COLLECTION) ? -te->directdata : -NULL; -Collection *collection = outliner_collection_from_tree_element(te); -if ((!layer_collection || !(layer_collection->flag & LAYER_COLLECTION_EXCLUDE)) && -!(collection->flag & COLLECTION_IS_MASTER)) { +PointerRNA collection_ptr; +PointerRNA layer_collection_ptr; - PointerRNA collection_ptr; - PointerRNA layer_collection_ptr; - RNA_id_pointer_create(&collection->id, &collection_ptr); - if (layer_collection != NULL) { -RNA_pointer_create( -&scene->id, &RNA_LayerCollection, layer_collection, &layer_collection_ptr); - } +if (outliner_restrict_properties_collection_set( +scene, te, &collection_ptr, &layer_collection_ptr, &props, &props_active)) { - /* Update the restriction column values for the collection children. */ - if (layer_collection) { -outliner_restrict_properties_enable_layer_collection_set( -&layer_collection_ptr, &collection_ptr, &props, &props_active); - } - else { -outliner_restrict_properties_enable_collection_set( -&collection_ptr, &props, &props_active); - } + LayerCollection *layer_collection = (tselem->type == TSE_LAYER_COLLECTION) ? + te->directdata : + NULL; + Collection *collection = outliner_collection_from_tree_element(te); if (layer_collect
[Bf-blender-cvs] [cb7ead2e3b6] master: Fix T68658: Text offset makes scale to fit not to work
Commit: cb7ead2e3b62b9f1df85c985801db7918204dd2a Author: Dalai Felinto Date: Wed Aug 14 15:08:25 2019 -0300 Branches: master https://developer.blender.org/rBcb7ead2e3b62b9f1df85c985801db7918204dd2a Fix T68658: Text offset makes scale to fit not to work Differential Revision: https://developer.blender.org/D5484 === M source/blender/blenkernel/intern/font.c === diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 78117a4f615..b55635560be 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -955,7 +955,7 @@ static bool vfont_to_curve(Object *ob, } } - current_line_length += xof; + current_line_length += xof - MARGIN_X_MIN; if (ct->dobreak) { current_line_length += twidth; } @@ -1026,7 +1026,7 @@ static bool vfont_to_curve(Object *ob, } ct++; } - current_line_length += xof + twidth; + current_line_length += xof + twidth - MARGIN_X_MIN; longest_line_length = MAX2(current_line_length, longest_line_length); cu->lines = 1; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cbd1739004f] master: Fix T68705: Changing any editor to the properties crashes Blender
Commit: cbd1739004f854f4970f95ea3ed512f2aecf2fe7 Author: Dalai Felinto Date: Thu Aug 15 16:38:31 2019 -0300 Branches: master https://developer.blender.org/rBcbd1739004f854f4970f95ea3ed512f2aecf2fe7 Fix T68705: Changing any editor to the properties crashes Blender Issue introduced (more like exposed) in b7f86ff72273. === M source/blender/editors/space_buttons/buttons_context.c === diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index fde8b8f85f8..bb381e0dd1e 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -785,11 +785,11 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r SpaceProperties *sbuts = CTX_wm_space_properties(C); ButsContextPath *path = sbuts ? sbuts->path : NULL; - if (sbuts->mainb == BCONTEXT_TOOL) { + if (!path) { return 0; } - if (!path) { + if (sbuts->mainb == BCONTEXT_TOOL) { return 0; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [870bb404a0c] temp-lanpr-staging: Fix T68705: Changing any editor to the properties crashes Blender
Commit: 870bb404a0c6813470c1f9f8fcaf436b9b970060 Author: Dalai Felinto Date: Thu Aug 15 16:38:31 2019 -0300 Branches: temp-lanpr-staging https://developer.blender.org/rB870bb404a0c6813470c1f9f8fcaf436b9b970060 Fix T68705: Changing any editor to the properties crashes Blender Issue introduced (more like exposed) in b7f86ff72273. === M source/blender/editors/space_buttons/buttons_context.c === diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 2a28dc56607..2e4c51e8802 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -821,11 +821,11 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r SpaceProperties *sbuts = CTX_wm_space_properties(C); ButsContextPath *path = sbuts ? sbuts->path : NULL; - if (sbuts->mainb == BCONTEXT_TOOL) { + if (!path) { return 0; } - if (!path) { + if (sbuts->mainb == BCONTEXT_TOOL) { return 0; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [101fadcf6b9] master: Motion Path: Tweak the User Interface
Commit: 101fadcf6b93c1388c4e4b5ccf0f0efcdc7a058d Author: Dalai Felinto Date: Fri Dec 17 12:29:54 2021 +0100 Branches: master https://developer.blender.org/rB101fadcf6b93c1388c4e4b5ccf0f0efcdc7a058d Motion Path: Tweak the User Interface This moves the clear paths button ("X") to the same line of "Update All Paths", and make it visible at all times. 1. The clear button affects all objects (by default). However the Calculate/Update Paths only works on the selected objects/objects. Better to not have them both on the same line. 2. The operator to clear object and pose paths can run even if the active object/bone has no motion path. However the UI was not showing the button in those cases. Before: {F12757500, size=full} After: {F12757502, size=full} Differential Revision: https://developer.blender.org/D13609 === M release/scripts/startup/bl_ui/properties_animviz.py === diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py index 44965a60489..28e456d023d 100644 --- a/release/scripts/startup/bl_ui/properties_animviz.py +++ b/release/scripts/startup/bl_ui/properties_animviz.py @@ -70,14 +70,10 @@ class MotionPathButtonsPanel: col = layout.column(align=True) -row = col.row(align=True) if bones: -row.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA') -row.operator("pose.paths_clear", text="", icon='X') +col.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA') else: -row.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA') -row.operator("object.paths_clear", text="", icon='X') -col.operator("object.paths_update_visible", text="Update All Paths", icon='WORLD') +col.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA') else: col = layout.column(align=True) col.label(text="Nothing to show yet...", icon='ERROR') @@ -86,7 +82,13 @@ class MotionPathButtonsPanel: col.operator("pose.paths_calculate", text="Calculate...", icon='BONE_DATA') else: col.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA') -col.operator("object.paths_update_visible", text="Update All Paths", icon='WORLD') + +row = col.row(align=True) +row.operator("object.paths_update_visible", text="Update All Paths", icon='WORLD') +if bones: +row.operator("pose.paths_clear", text="", icon='X') +else: +row.operator("object.paths_clear", text="", icon='X') class MotionPathButtonsPanel_display: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [d320f3677e2] master: Cleanup: make format
Commit: d320f3677e2a98b12d386a3e6f3da2d7b7018463 Author: Dalai Felinto Date: Wed Jan 12 11:29:18 2022 +0100 Branches: master https://developer.blender.org/rBd320f3677e2a98b12d386a3e6f3da2d7b7018463 Cleanup: make format === M source/blender/imbuf/intern/radiance_hdr.c === diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c index 0bca68b93bc..925ef0a8502 100644 --- a/source/blender/imbuf/intern/radiance_hdr.c +++ b/source/blender/imbuf/intern/radiance_hdr.c @@ -255,12 +255,7 @@ struct ImBuf *imb_loadhdr(const unsigned char *mem, char buf[32] = {0}; memcpy(buf, &mem[x], MIN2(sizeof(buf) - 1, size - x)); - if (sscanf(buf, - "%2s %d %2s %d", - (char *)&oriY, - &height, - (char *)&oriX, - &width) != 4) { + if (sscanf(buf, "%2s %d %2s %d", (char *)&oriY, &height, (char *)&oriX, &width) != 4) { return NULL; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f3fea47f6ce] temp-sculpt-colors: Merge remote-tracking branch 'origin/master' into temp-sculpt-colors
Commit: f3fea47f6ceffed7294f89ee0ed9531f2d86b6c0 Author: Dalai Felinto Date: Wed Jan 12 11:31:20 2022 +0100 Branches: temp-sculpt-colors https://developer.blender.org/rBf3fea47f6ceffed7294f89ee0ed9531f2d86b6c0 Merge remote-tracking branch 'origin/master' into temp-sculpt-colors === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fe24c6bb8bd] temp-sculpt-colors: Cleanup: make format
Commit: fe24c6bb8bd845a7c1f75b18fea694466a2d8d8f Author: Dalai Felinto Date: Wed Jan 12 11:32:25 2022 +0100 Branches: temp-sculpt-colors https://developer.blender.org/rBfe24c6bb8bd845a7c1f75b18fea694466a2d8d8f Cleanup: make format === M source/blender/blenkernel/intern/attribute.c M source/blender/blenkernel/intern/mesh.cc M source/blender/makesrna/intern/rna_attribute.c M source/blender/makesrna/intern/rna_internal.h === diff --git a/source/blender/blenkernel/intern/attribute.c b/source/blender/blenkernel/intern/attribute.c index f89e678f3e0..50c69f26537 100644 --- a/source/blender/blenkernel/intern/attribute.c +++ b/source/blender/blenkernel/intern/attribute.c @@ -714,4 +714,3 @@ bool BKE_id_attribute_ref_equals(const struct AttributeRef *ref1, const struct A return ok && STREQ(ref1->name, ref2->name); } - diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index 62ae4f5f0e6..1aa5f776a77 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -97,10 +97,7 @@ static void mesh_init_data(ID *id) mesh->face_sets_color_seed = BLI_hash_int(PIL_check_seconds_timer_i() & UINT_MAX); } -static void mesh_copy_data(Main *bmain, - ID *id_dst, - const ID *id_src, - const int flag) +static void mesh_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag) { Mesh *mesh_dst = (Mesh *)id_dst; const Mesh *mesh_src = (const Mesh *)id_src; diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c index b7cbdf978f3..25537ca318d 100644 --- a/source/blender/makesrna/intern/rna_attribute.c +++ b/source/blender/makesrna/intern/rna_attribute.c @@ -372,7 +372,6 @@ PointerRNA rna_AttributeGroup_iterator_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, type, layer); } - void rna_AttributeGroup_color_iterator_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { memset(&iter->internal.array, 0, sizeof(iter->internal.array)); diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 8b01c60749e..fe70154b7e6 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -695,4 +695,3 @@ void rna_AttributeGroup_color_iterator_begin(CollectionPropertyIterator *iter, P void rna_AttributeGroup_color_iterator_next(CollectionPropertyIterator *iter); PointerRNA rna_AttributeGroup_color_iterator_get(CollectionPropertyIterator *iter); int rna_AttributeGroup_color_length(PointerRNA *ptr); - ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f756dc4812f] blender-v3.1-release: Blender 3.1 Beta- subversion bump
Commit: f756dc4812f3852bba54ee46c21288540f066672 Author: Dalai Felinto Date: Fri Jan 28 11:11:11 2022 +0100 Branches: blender-v3.1-release https://developer.blender.org/rBf756dc4812f3852bba54ee46c21288540f066672 Blender 3.1 Beta- subversion bump === M source/blender/blenkernel/BKE_blender_version.h M source/blender/blenloader/intern/versioning_300.c === diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 573b4e33f8c..d1f31e0d2f5 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 5 +#define BLENDER_FILE_SUBVERSION 6 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 81fc6086951..90730439c51 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -782,19 +782,7 @@ void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) } } - /** - * Versioning code until next subversion bump goes here. - * - * \note Be sure to check when bumping the version: - * - #blo_do_versions_300 in this file. - * - "versioning_userdef.c", #blo_do_versions_userdef - * - "versioning_userdef.c", #do_versions_theme - * - * \note Keep this message at the bottom of the function. - */ - { -/* Keep this block, even when empty. */ - + if (!MAIN_VERSION_ATLEAST(bmain, 301, 6)) { { /* Ensure driver variable names are unique within the driver. */ ID *id; FOREACH_MAIN_ID_BEGIN (bmain, id) { @@ -829,6 +817,20 @@ void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) } } } + + /** + * Versioning code until next subversion bump goes here. + * + * \note Be sure to check when bumping the version: + * - #blo_do_versions_300 in this file. + * - "versioning_userdef.c", #blo_do_versions_userdef + * - "versioning_userdef.c", #do_versions_theme + * + * \note Keep this message at the bottom of the function. + */ + { +/* Keep this block, even when empty. */ + } } static void version_switch_node_input_prefix(Main *bmain) @@ -2485,18 +2487,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - /** - * Versioning code until next subversion bump goes here. - * - * \note Be sure to check when bumping the version: - * - "versioning_userdef.c", #blo_do_versions_userdef - * - "versioning_userdef.c", #do_versions_theme - * - * \note Keep this message at the bottom of the function. - */ - { -/* Keep this block, even when empty. */ - + if (!MAIN_VERSION_ATLEAST(bmain, 301, 6)) { /* Add node storage for map range node. */ FOREACH_NODETREE_BEGIN (bmain, ntree, id) { LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { @@ -2557,4 +2548,17 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /** + * Versioning code until next subversion bump goes here. + * + * \note Be sure to check when bumping the version: + * - "versioning_userdef.c", #blo_do_versions_userdef + * - "versioning_userdef.c", #do_versions_theme + * + * \note Keep this message at the bottom of the function. + */ + { +/* Keep this block, even when empty. */ + } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cfe18c3b949] master: Merge remote-tracking branch 'origin/blender-v3.1-release'
Commit: cfe18c3b949d019e2e77203265528e8a995b7517 Author: Dalai Felinto Date: Fri Jan 28 11:11:51 2022 +0100 Branches: master https://developer.blender.org/rBcfe18c3b949d019e2e77203265528e8a995b7517 Merge remote-tracking branch 'origin/blender-v3.1-release' === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b217eb73f58] blender-v3.1-release: Licenses: Attribution document for Blender 3.1
Commit: b217eb73f58dc2a159bd464140fb4900e0c363a9 Author: Dalai Felinto Date: Tue Mar 8 18:26:50 2022 +0100 Branches: blender-v3.1-release https://developer.blender.org/rBb217eb73f58dc2a159bd464140fb4900e0c363a9 Licenses: Attribution document for Blender 3.1 === M release/license/THIRD-PARTY-LICENSES.txt === diff --git a/release/license/THIRD-PARTY-LICENSES.txt b/release/license/THIRD-PARTY-LICENSES.txt index 2bd4ac23d6d..933f03b5564 100644 --- a/release/license/THIRD-PARTY-LICENSES.txt +++ b/release/license/THIRD-PARTY-LICENSES.txt @@ -318,7 +318,7 @@ Copyright (c) 2006, Google Inc. All rights reserved. ** ISPC; version 1.16.0 -- https://github.com/ispc/ispc Copyright Intel Corporation -** NumPy; version 1.21.2 -- https://numpy.org/ +** NumPy; version 1.22.0 -- https://numpy.org/ Copyright (c) 2005-2021, NumPy Developers. ** Open Shading Language; version 1.11.14.1 -- https://github.com/imageworks/OpenShadingLanguage @@ -822,7 +822,7 @@ Yoyodyne, Inc., hereby disclaims all copyright interest in the program ** FFTW; version 3.3.8 -- http://www.fftw.org/ Copyright (c) 2003, 2007-14 Matteo Frigo Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology -** GMP; version 6.2.0 -- https://gmplib.org/ +** GMP; version 6.2.1 -- https://gmplib.org/ Copyright 1996-2020 Free Software Foundation, Inc. ** OpenAL; version 1.20.1 -- http://openal-soft.org Copyright (c) 2015, Archontis Politis @@ -1162,7 +1162,7 @@ Copyright (C) 2003-2021 x264 project ** miniLZO; version 2.08 -- http://www.oberhumer.com/opensource/lzo/ LZO and miniLZO are Copyright (C) 1996-2014 Markus Franz Xaver Oberhumer All Rights Reserved. -** The FreeType Project; version 2.10.2 -- +** The FreeType Project; version 2.11.1 -- https://sourceforge.net/projects/freetype Copyright (C) 1996-2020 by David Turner, Robert Wilhelm, and Werner Lemberg. ** X Drag and Drop; version 2000-08-08 -- @@ -1174,7 +1174,7 @@ Project initiators: Christoph Lampert Michael Militzer Peter Ross -** Zstandard; version 1.5.0 -- https://github.com/facebook/zstd +** Zstandard; version 1.6.0 -- https://github.com/facebook/zstd Copyright (c) 2016-present, Facebook, Inc. All rights reserved. GNU GENERAL PUBLIC LICENSE @@ -2956,6 +2956,8 @@ December 9, 2010 -- +** Brotli; version 1.0.9 -- https://github.com/google/brotli +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. ** Expat; version 2.2.10 -- https://github.com/libexpat/libexpat/ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper Copyright (c) 2001-2019 Expat maintainers @@ -3627,7 +3629,7 @@ disclaims all warranties with regard to this software. -- -** Python; version 3.9.7 -- https://www.python.org +** Python; version 3.10.2 -- https://www.python.org Copyright (c) 2001-2021 Python Software Foundation. All rights reserved. A. HISTORY OF THE SOFTWARE ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [dd483215e58] master: Hair: Sculpt Mode Icons
Commit: dd483215e58f09a8da8de9f79c6da080cdeeb92c Author: Dalai Felinto Date: Thu Mar 17 12:12:51 2022 +0100 Branches: master https://developer.blender.org/rBdd483215e58f09a8da8de9f79c6da080cdeeb92c Hair: Sculpt Mode Icons From hair particle mode: * Add * Comb * Cut * Grow New: * Delete Only comb and delete are used at the moment (by the new tools which are under experimental). === A release/datafiles/icons/ops.curves.sculpt_add.dat A release/datafiles/icons/ops.curves.sculpt_comb.dat A release/datafiles/icons/ops.curves.sculpt_cut.dat A release/datafiles/icons/ops.curves.sculpt_delete.dat A release/datafiles/icons/ops.curves.sculpt_grow.dat M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/release/datafiles/icons/ops.curves.sculpt_add.dat b/release/datafiles/icons/ops.curves.sculpt_add.dat new file mode 100644 index 000..b66f4da5b71 Binary files /dev/null and b/release/datafiles/icons/ops.curves.sculpt_add.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_comb.dat b/release/datafiles/icons/ops.curves.sculpt_comb.dat new file mode 100644 index 000..d6dd75a35d7 Binary files /dev/null and b/release/datafiles/icons/ops.curves.sculpt_comb.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_cut.dat b/release/datafiles/icons/ops.curves.sculpt_cut.dat new file mode 100644 index 000..e7ef86e2fbc Binary files /dev/null and b/release/datafiles/icons/ops.curves.sculpt_cut.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_delete.dat b/release/datafiles/icons/ops.curves.sculpt_delete.dat new file mode 100644 index 000..896d472e017 Binary files /dev/null and b/release/datafiles/icons/ops.curves.sculpt_delete.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_grow.dat b/release/datafiles/icons/ops.curves.sculpt_grow.dat new file mode 100644 index 000..9b3453085e4 Binary files /dev/null and b/release/datafiles/icons/ops.curves.sculpt_grow.dat differ diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 48f9c50ad4e..d58bbec01cd 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -770,6 +770,11 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.curve.extrude_move ops.curve.radius ops.curve.vertex_random + ops.curves.sculpt_add + ops.curves.sculpt_comb + ops.curves.sculpt_cut + ops.curves.sculpt_delete + ops.curves.sculpt_grow ops.generic.cursor ops.generic.select ops.generic.select_box ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3b745f3455c] master: Cleanup: make format + extra parenthesis
Commit: 3b745f3455c30f73a26f6c67f52f6a148bf98ca7 Author: Dalai Felinto Date: Tue Mar 22 11:36:10 2022 +0100 Branches: master https://developer.blender.org/rB3b745f3455c30f73a26f6c67f52f6a148bf98ca7 Cleanup: make format + extra parenthesis Nested ? : get better formatted with some parenthesis around the expressions. === M source/blender/draw/engines/gpencil/gpencil_cache_utils.c === diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index 7bfbcfa9e21..be35660a4d7 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -269,8 +269,8 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd, float vert_col_opacity = (override_vertcol) ? (is_vert_col_mode ? pd->vertex_paint_opacity : 0.0f) : - pd->is_render ? gpl->vertex_paint_opacity : - pd->vertex_paint_opacity; + (pd->is_render ? gpl->vertex_paint_opacity : +pd->vertex_paint_opacity); /* Negate thickness sign to tag that strokes are in screen space. * Convert to world units (by default, 1 meter = 2000 pixels). */ float thickness_scale = (is_screenspace) ? -1.0f : (gpd->pixfactor / GPENCIL_PIXEL_FACTOR); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7a028330d2d] master: Cleanup: clang-format
Commit: 7a028330d2d1061bfaaa5125e3372fbee2cff26e Author: Dalai Felinto Date: Thu Mar 24 11:01:12 2022 +0100 Branches: master https://developer.blender.org/rB7a028330d2d1061bfaaa5125e3372fbee2cff26e Cleanup: clang-format === M intern/cycles/hydra/curves.h M intern/cycles/hydra/mesh.h M intern/cycles/hydra/node_util.h M intern/cycles/hydra/pointcloud.h M intern/cycles/hydra/volume.h M intern/cycles/scene/integrator.cpp M source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc M source/blender/makesrna/intern/rna_scene.c M source/blender/nodes/shader/nodes/node_shader_tex_sky.cc === diff --git a/intern/cycles/hydra/curves.h b/intern/cycles/hydra/curves.h index a1ac4a86715..1eb4a51c0db 100644 --- a/intern/cycles/hydra/curves.h +++ b/intern/cycles/hydra/curves.h @@ -13,10 +13,11 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE class HdCyclesCurves final : public HdCyclesGeometry { public: - HdCyclesCurves(const PXR_NS::SdfPath &rprimId + HdCyclesCurves( + const PXR_NS::SdfPath &rprimId #if PXR_VERSION < 2102 - , - const PXR_NS::SdfPath &instancerId = {} + , + const PXR_NS::SdfPath &instancerId = {} #endif ); ~HdCyclesCurves() override; diff --git a/intern/cycles/hydra/mesh.h b/intern/cycles/hydra/mesh.h index e7aa2e4fa94..8ec108534a1 100644 --- a/intern/cycles/hydra/mesh.h +++ b/intern/cycles/hydra/mesh.h @@ -14,10 +14,11 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE class HdCyclesMesh final : public HdCyclesGeometry { public: - HdCyclesMesh(const PXR_NS::SdfPath &rprimId + HdCyclesMesh( + const PXR_NS::SdfPath &rprimId #if PXR_VERSION < 2102 - , - const PXR_NS::SdfPath &instancerId = {} + , + const PXR_NS::SdfPath &instancerId = {} #endif ); ~HdCyclesMesh() override; diff --git a/intern/cycles/hydra/node_util.h b/intern/cycles/hydra/node_util.h index e91f554cc45..009a4a9eb38 100644 --- a/intern/cycles/hydra/node_util.h +++ b/intern/cycles/hydra/node_util.h @@ -4,8 +4,8 @@ #pragma once -#include "hydra/config.h" #include "graph/node.h" +#include "hydra/config.h" #include diff --git a/intern/cycles/hydra/pointcloud.h b/intern/cycles/hydra/pointcloud.h index aa1768e807f..a014a389dcc 100644 --- a/intern/cycles/hydra/pointcloud.h +++ b/intern/cycles/hydra/pointcloud.h @@ -13,10 +13,11 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE class HdCyclesPoints final : public HdCyclesGeometry { public: - HdCyclesPoints(const PXR_NS::SdfPath &rprimId + HdCyclesPoints( + const PXR_NS::SdfPath &rprimId #if PXR_VERSION < 2102 - , - const PXR_NS::SdfPath &instancerId = {} + , + const PXR_NS::SdfPath &instancerId = {} #endif ); ~HdCyclesPoints() override; diff --git a/intern/cycles/hydra/volume.h b/intern/cycles/hydra/volume.h index 775a7cf069e..7fb5fa779b5 100644 --- a/intern/cycles/hydra/volume.h +++ b/intern/cycles/hydra/volume.h @@ -13,10 +13,11 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE class HdCyclesVolume final : public HdCyclesGeometry { public: - HdCyclesVolume(const PXR_NS::SdfPath &rprimId + HdCyclesVolume( + const PXR_NS::SdfPath &rprimId #if PXR_VERSION < 2102 - , - const PXR_NS::SdfPath &instancerId = {} + , + const PXR_NS::SdfPath &instancerId = {} #endif ); ~HdCyclesVolume() override; diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp index 755fbb9542b..fd559178073 100644 --- a/intern/cycles/scene/integrator.cpp +++ b/intern/cycles/scene/integrator.cpp @@ -109,8 +109,10 @@ NODE_DEFINE(Integrator) SOCKET_INT(denoise_start_sample, "Start Sample to Denoise", 0); SOCKET_BOOLEAN(use_denoise_pass_albedo, "Use Albedo Pass for Denoiser", true); SOCKET_BOOLEAN(use_denoise_pass_normal, "Use Normal Pass for Denoiser", true); - SOCKET_ENUM( - denoiser_prefilter, "Denoiser Prefilter", denoiser_prefilter_enum, DENOISER_PREFILTER_ACCURATE); + SOCKET_ENUM(denoiser_prefilter, + "Denoiser Prefilter", + denoiser_prefilter_enum, + DENOISER_PREFILTER_ACCURATE); return type; } diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc index a027718a4f3..aa63e65b1e8 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc @@ -382,8 +382,8 @@ void OBJMesh::store_normal_coords_and_indices() normal_to_index.reserve(export_mesh_eval_->totpoly); loop_to_normal_index_.resize(export_mesh_eval_->totloop); loop_to_normal_index_.fill(-1
[Bf-blender-cvs] [643da14a4ef] master: Fix `make source_archive_complete` for release branches
Commit: 643da14a4efd6a0eeb9ed21dd68643fdc7a6359e Author: Dalai Felinto Date: Wed Mar 23 12:01:11 2022 +0100 Branches: master https://developer.blender.org/rB643da14a4efd6a0eeb9ed21dd68643fdc7a6359e Fix `make source_archive_complete` for release branches In Blender 3.1 we can't run the source_archive_complete because the cmake program is trying to download the packages from svn trunk. However 3.2 (aka master) already changed the version of some of the source packages. For example the OpenXR-SDK. It should be looking for OpenXR-SDK-1.0.17.tar.gz in: https://svn.blender.org/svnroot/bf-blender/tags/blender-3.1-release/lib/packages/ But instead it tries to look for it in: https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/ Which can't be found since it was replaced with OpenXR-SDK-1.0.22.tar.gz --- Release checklist: https://wiki.blender.org/wiki/Process/Release_Checklist The release checklist was updated to include the new instructions: `In the release branch, update and uncomment BLENDER_VERSION in download.cmake` Differential Revision: http://developer.blender.org/D14292 === M build_files/build_environment/cmake/download.cmake === diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index b92073636f5..5ca46c15d8d 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -1,11 +1,16 @@ # SPDX-License-Identifier: GPL-2.0-or-later +## Update and uncomment this in the release branch +# set(BLENDER_VERSION 3.1) + function(download_source dep) set(TARGET_FILE ${${dep}_FILE}) set(TARGET_HASH_TYPE ${${dep}_HASH_TYPE}) set(TARGET_HASH ${${dep}_HASH}) if(PACKAGE_USE_UPSTREAM_SOURCES) set(TARGET_URI ${${dep}_URI}) + elseif(BLENDER_VERSION) +set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE}) else() set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE}) endif() ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [218bcff32db] master: Iterator to loop over objects based on a flag
Commit: 218bcff32db55874ccc35300ddd21baa585350dd Author: Dalai Felinto Date: Wed Mar 30 11:06:01 2022 +0200 Branches: master https://developer.blender.org/rB218bcff32db55874ccc35300ddd21baa585350dd Iterator to loop over objects based on a flag === M source/blender/blenkernel/BKE_collection.h M source/blender/blenkernel/BKE_layer.h M source/blender/blenkernel/intern/collection.c === diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index 7f4360d2e9c..a3bbcc8687a 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -346,6 +346,20 @@ void BKE_scene_objects_iterator_begin(struct BLI_Iterator *iter, void *data_in); void BKE_scene_objects_iterator_next(struct BLI_Iterator *iter); void BKE_scene_objects_iterator_end(struct BLI_Iterator *iter); +/** Iterate over objects in the scene based on a flag. + * + * \note The object->flag is tested against flag. + * */ +typedef struct SceneObjectsIteratorExData { + struct Scene *scene; + int flag; + void *iter_data; +} SceneObjectsIteratorExData; + +void BKE_scene_objects_iterator_begin_ex(struct BLI_Iterator *iter, void *data_in); +void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter); +void BKE_scene_objects_iterator_end_ex(struct BLI_Iterator *iter); + /** * Generate a new #GSet (or extend given `objects_gset` if not NULL) with all objects referenced by * all collections of given `scene`. diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 77a3223c064..c877035830c 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -436,15 +436,26 @@ void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter); IteratorBeginCb func_begin; \ IteratorCb func_next, func_end; \ void *data_in; \ -struct ObjectsVisibleIteratorData data_ = {NULL}; \ -data_.view_layer = _view_layer; \ -data_.v3d = _v3d; \ +\ +struct ObjectsVisibleIteratorData data_select_ = {NULL}; \ +data_select_.view_layer = _view_layer; \ +data_select_.v3d = _v3d; \ +\ +struct SceneObjectsIteratorExData data_flag_ = {NULL}; \ +data_flag_.scene = scene; \ +data_flag_.flag = flag; \ \ if (flag == SELECT) { \ func_begin = &BKE_view_layer_selected_objects_iterator_begin; \ func_next = &BKE_view_layer_selected_objects_iterator_next; \ func_end = &BKE_view_layer_selected_objects_iterator_end; \ - data_in = &data_; \ + data_in = &data_select_; \ +} \ +else if (flag != 0) { \ + func_begin = BKE_scene_objects_iterator_begin_ex; \ + func_next = BKE_scene_objects_iterator_next_ex; \ + func_end = BKE_scene_objects_iterator_end_ex; \ + data_in = &data_flag_; \ } \ else { \ func_begin = BKE_scene_objects_iterator_begin; \ diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index bdaea487cfb..c215321bc30 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1929,6 +1929,48 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in) scene_objects_iterator_begin(iter, scene, NULL); } +void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in) +{ + SceneObjectsIteratorExData *data = data_in; + + BKE_scene_objects_iterator_begin(iter, data->scene); + + /* Pack the data. */ + data->iter_data = iter->data; + iter->data = data_in; +} + +void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter) +{ + /* Unpack the data. */ + SceneObjectsIteratorExData *data = iter->data; + iter->data = data->iter_data; + + BKE_scene_objects_iterator_next(iter); + + Object *ob = iter->current; + if (ob && (ob->flag & data->flag) == 0) { +iter->skip = true; + } + + /* Pack the data. */ + data->iter_data = iter->data; + iter->data = data; +} + +void BKE_scene_objects_iterator_end_ex(struct BLI_Iterator *iter) +{ + /* Unpack the data. */ + SceneObjectsIteratorExData *data = iter->data; + iter->data = data->iter_data; + + BKE_scene_objects_iterator_end(iter); + + /* Pack the data. */ + data->iter_data = iter->data; + iter->data = data; +} + /** * Ensures we only get each object once, even when included in several collections. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [35f34a3cf84] master: Modifiers: Support applying modifiers for multi-user data
Commit: 35f34a3cf840852b70c1be5910be5517265d96cc Author: Dalai Felinto Date: Wed Mar 30 11:06:10 2022 +0200 Branches: master https://developer.blender.org/rB35f34a3cf840852b70c1be5910be5517265d96cc Modifiers: Support applying modifiers for multi-user data The current behaviour is to prevent multi-user data from having its modifier applied. Instead, with this patch, we now warn the user that if they want to proceed the object will be made single-user. Note that this only makes the object data single-user. Not the material or actions. As a future step we can apply the same behaviour for the Grease Pencil modifiers Differential Revision: https://developer.blender.org/D14381 === M source/blender/editors/include/ED_object.h M source/blender/editors/object/object_modifier.c M source/blender/editors/object/object_relations.c === diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index abadbe5a5c6..54e434e0db5 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -381,6 +381,8 @@ struct Object *ED_object_add_type(struct bContext *C, */ void ED_object_single_user(struct Main *bmain, struct Scene *scene, struct Object *ob); +void ED_object_single_obdata_user(struct Main *bmain, struct Scene *scene, struct Object *ob); + /* object motion paths */ /** diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0e09fbb7ea4..545265b18b1 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1363,7 +1363,7 @@ void OBJECT_OT_modifier_move_to_index(wmOperatorType *ot) /** \name Apply Modifier Operator * \{ */ -static bool modifier_apply_poll_ex(bContext *C, bool allow_shared) +static bool modifier_apply_poll(bContext *C) { if (!edit_modifier_poll_generic(C, &RNA_Modifier, 0, false, false)) { return false; @@ -1378,10 +1378,6 @@ static bool modifier_apply_poll_ex(bContext *C, bool allow_shared) CTX_wm_operator_poll_msg_set(C, "Modifiers cannot be applied on override data"); return false; } - if (!allow_shared && (ob->data != NULL) && ID_REAL_USERS(ob->data) > 1) { -CTX_wm_operator_poll_msg_set(C, "Modifiers cannot be applied to multi-user data"); -return false; - } if (md != NULL) { if ((ob->mode & OB_MODE_SCULPT) && (find_multires_modifier_before(scene, md)) && (BKE_modifier_is_same_topology(md) == false)) { @@ -1393,11 +1389,6 @@ static bool modifier_apply_poll_ex(bContext *C, bool allow_shared) return true; } -static bool modifier_apply_poll(bContext *C) -{ - return modifier_apply_poll_ex(C, false); -} - static int modifier_apply_exec_ex(bContext *C, wmOperator *op, int apply_as, bool keep_modifier) { Main *bmain = CTX_data_main(C); @@ -1406,11 +1397,19 @@ static int modifier_apply_exec_ex(bContext *C, wmOperator *op, int apply_as, boo Object *ob = ED_object_active_context(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); const bool do_report = RNA_boolean_get(op->ptr, "report"); + const bool do_single_user = RNA_boolean_get(op->ptr, "single_user"); if (md == NULL) { return OPERATOR_CANCELLED; } + if (do_single_user && ID_REAL_USERS(ob->data) > 1) { +ED_object_single_obdata_user(bmain, scene, ob); +BKE_main_id_newptr_and_tag_clear(bmain); +WM_event_add_notifier(C, NC_WINDOW, NULL); +DEG_relations_tag_update(bmain); + } + int reports_len; char name[MAX_NAME]; if (do_report) { @@ -1447,6 +1446,19 @@ static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *eve { int retval; if (edit_modifier_invoke_properties_with_hover(C, op, event, &retval)) { +PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); +Object *ob = (ptr.owner_id != NULL) ? (Object *)ptr.owner_id : ED_object_active_context(C); + +if ((ob->data != NULL) && ID_REAL_USERS(ob->data) > 1) { + PropertyRNA *prop = RNA_struct_find_property(op->ptr, "single_user"); + if (!RNA_property_is_set(op->ptr, prop)) { +RNA_property_boolean_set(op->ptr, prop, true); + } + if (RNA_property_boolean_get(op->ptr, prop)) { +return WM_operator_confirm_message( +C, op, "Make object data single-user and apply modifier"); + } +} return modifier_apply_exec(C, op); } return retval; @@ -1467,6 +1479,13 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot) edit_modifier_properties(ot); edit_modifier_report_property(ot); + + PropertyRNA *prop = RNA_def_
[Bf-blender-cvs] [8621fdb10dc] master: Apply Object Transform: Multi-user data support
Commit: 8621fdb10dc402eeff5aa996eeb992a513afd4c0 Author: Dalai Felinto Date: Wed Mar 30 11:07:29 2022 +0200 Branches: master https://developer.blender.org/rB8621fdb10dc402eeff5aa996eeb992a513afd4c0 Apply Object Transform: Multi-user data support The current behaviour is to prevent multi-user data from having its transformation applied. However in some particular cases it is possible to apply them: * If all the users of the multi-user data are part of the selection. * If not all the users are in the selection but the selection is made single-user. The active object is used as reference to set the transformation of the other selected objects. Note: For simplicity sake, this new behaviour is only available if all the selection is using the same data. Differential Revision: https://developer.blender.org/D14377 === M release/scripts/startup/bl_ui/space_view3d.py M source/blender/editors/object/object_transform.cc === diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index e78ea9d7fc1..0919faa8460 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2640,6 +2640,8 @@ class VIEW3D_MT_object_apply(Menu): def draw(self, _context): layout = self.layout +# Need invoke for the popup confirming the multi-user data operation +layout.operator_context = 'INVOKE_DEFAULT' props = layout.operator("object.transform_apply", text="Location", text_ctxt=i18n_contexts.default) props.location, props.rotation, props.scale = True, False, False diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index da75703a0d9..e279ebbb02e 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -587,18 +587,99 @@ static Array sorted_selected_editable_objects(bContext *C) return sorted_objects; } +/** + * Check if we need and can handle the special multiuser case. + */ +static bool apply_objects_internal_can_multiuser(bContext *C) +{ + Object *obact = CTX_data_active_object(C); + + if (ELEM(NULL, obact, obact->data)) { +return false; + } + + if (ID_REAL_USERS(obact->data) == 1) { +return false; + } + + bool all_objects_same_data = true; + bool obact_selected = false; + + CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { +if (ob->data != obact->data) { + all_objects_same_data = false; + break; +} + +if (ob == obact) { + obact_selected = true; +} + } + CTX_DATA_END; + + return all_objects_same_data && obact_selected; +} + +/** + * Check if the current selection need to be made into single user + * + * It assumes that all selected objects share the same object data. + */ +static bool apply_objects_internal_need_single_user(bContext *C) +{ + Object *ob = CTX_data_active_object(C); + BLI_assert(apply_objects_internal_can_multiuser(C)); + + /* Counting the number of objects is valid since it's known the + * selection is only made up of users of the active objects data. */ + return (ID_REAL_USERS(ob->data) > CTX_DATA_COUNT(C, selected_editable_objects)); +} + static int apply_objects_internal(bContext *C, ReportList *reports, bool apply_loc, bool apply_rot, bool apply_scale, - bool do_props) + bool do_props, + bool do_single_user) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale; bool changed = true; + bool do_multi_user = apply_objects_internal_can_multiuser(C); + float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4]; + + /* Only used when do_multi_user is set .*/ + Object *obact = NULL; + bool make_single_user = false; + + if (do_multi_user) { +obact = CTX_data_active_object(C); +invert_m4_m4(obact_invmat, obact->obmat); + +Object workob; +BKE_object_workob_calc_parent(depsgraph, scene, obact, &workob); +copy_m4_m4(obact_parent, workob.obmat); +copy_m4_m4(obact_parentinv, obact->parentinv); + +if (apply_objects_internal_need_single_user(C)) { + if (do_single_user) { +make_single_user = true; + } + else { +ID *obact_data = static_cast(obact->data); +BKE_reportf(reports, +RPT_ERROR, +"Cannot apply to a multi user
[Bf-blender-cvs] [9b25fafbec3] master: Cleanup: Left over from review of apply transform
Commit: 9b25fafbec3f3d7324600b6ce0aacfbee7d0e21e Author: Dalai Felinto Date: Wed Mar 30 12:23:39 2022 +0200 Branches: master https://developer.blender.org/rB9b25fafbec3f3d7324600b6ce0aacfbee7d0e21e Cleanup: Left over from review of apply transform I miss the review notes about this for the 8621fdb10dc402eeff5aa996eeb992a513afd4c0 commit. === M source/blender/editors/object/object_transform.cc === diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index e279ebbb02e..36d70eeef64 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -621,7 +621,7 @@ static bool apply_objects_internal_can_multiuser(bContext *C) } /** - * Check if the current selection need to be made into single user + * Check if the current selection need to be made into single user. * * It assumes that all selected objects share the same object data. */ @@ -648,10 +648,10 @@ static int apply_objects_internal(bContext *C, Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale; bool changed = true; - bool do_multi_user = apply_objects_internal_can_multiuser(C); + bool const do_multi_user = apply_objects_internal_can_multiuser(C); float obact_invmat[4][4], obact_parent[4][4], obact_parentinv[4][4]; - /* Only used when do_multi_user is set .*/ + /* Only used when do_multi_user is set. */ Object *obact = NULL; bool make_single_user = false; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: bf-blender [62865] trunk/lib/resources/icon_geom.blend: Curves sculpt icons
Revision: 62865 https://developer.blender.org/rBL62865 Author: dfelinto Date: 2022-03-31 10:34:27 +0200 (Thu, 31 Mar 2022) Log Message: --- Curves sculpt icons Modified Paths: -- trunk/lib/resources/icon_geom.blend Modified: trunk/lib/resources/icon_geom.blend === (Binary files differ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [9db15f502c1] master: Fix T97123: Applying modifier to multi-user: other objects were also converted
Commit: 9db15f502c105f96f0ec939dd2fc79f4567a4bf7 Author: Dalai Felinto Date: Thu Apr 7 14:51:59 2022 +0200 Branches: master https://developer.blender.org/rB9db15f502c105f96f0ec939dd2fc79f4567a4bf7 Fix T97123: Applying modifier to multi-user: other objects were also converted The first element of the iterator was not being tested against the flag. So in some cases it would lead to more objects been made into single-user than the active (or selected) ones. === M source/blender/blenkernel/intern/collection.c === diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index c215321bc30..939f7c7b3ff 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1929,6 +1929,26 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in) scene_objects_iterator_begin(iter, scene, NULL); } +static void scene_objects_iterator_skip_invalid_flag(BLI_Iterator *iter) +{ + if (!iter->valid) { +return; + } + + /* Unpack the data. */ + SceneObjectsIteratorExData *data = iter->data; + iter->data = data->iter_data; + + Object *ob = iter->current; + if (ob && (ob->flag & data->flag) == 0) { +iter->skip = true; + } + + /* Pack the data. */ + data->iter_data = iter->data; + iter->data = data; +} + void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in) { SceneObjectsIteratorExData *data = data_in; @@ -1938,6 +1958,8 @@ void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in) /* Pack the data. */ data->iter_data = iter->data; iter->data = data_in; + + scene_objects_iterator_skip_invalid_flag(iter); } void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter) @@ -1948,14 +1970,11 @@ void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter) BKE_scene_objects_iterator_next(iter); - Object *ob = iter->current; - if (ob && (ob->flag & data->flag) == 0) { -iter->skip = true; - } - /* Pack the data. */ data->iter_data = iter->data; iter->data = data; + + scene_objects_iterator_skip_invalid_flag(iter); } void BKE_scene_objects_iterator_end_ex(struct BLI_Iterator *iter) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [520e80d9ccb] temp-T96710-pbvh-pixels: Fix T97123: Applying modifier to multi-user: other objects were also converted
Commit: 520e80d9ccb96bc9c22ca7ccbca946357ad6243b Author: Dalai Felinto Date: Thu Apr 7 14:51:59 2022 +0200 Branches: temp-T96710-pbvh-pixels https://developer.blender.org/rB520e80d9ccb96bc9c22ca7ccbca946357ad6243b Fix T97123: Applying modifier to multi-user: other objects were also converted The first element of the iterator was not being tested against the flag. So in some cases it would lead to more objects been made into single-user than the active (or selected) ones. === M source/blender/blenkernel/intern/collection.c === diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index c215321bc30..939f7c7b3ff 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1929,6 +1929,26 @@ void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in) scene_objects_iterator_begin(iter, scene, NULL); } +static void scene_objects_iterator_skip_invalid_flag(BLI_Iterator *iter) +{ + if (!iter->valid) { +return; + } + + /* Unpack the data. */ + SceneObjectsIteratorExData *data = iter->data; + iter->data = data->iter_data; + + Object *ob = iter->current; + if (ob && (ob->flag & data->flag) == 0) { +iter->skip = true; + } + + /* Pack the data. */ + data->iter_data = iter->data; + iter->data = data; +} + void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in) { SceneObjectsIteratorExData *data = data_in; @@ -1938,6 +1958,8 @@ void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in) /* Pack the data. */ data->iter_data = iter->data; iter->data = data_in; + + scene_objects_iterator_skip_invalid_flag(iter); } void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter) @@ -1948,14 +1970,11 @@ void BKE_scene_objects_iterator_next_ex(struct BLI_Iterator *iter) BKE_scene_objects_iterator_next(iter); - Object *ob = iter->current; - if (ob && (ob->flag & data->flag) == 0) { -iter->skip = true; - } - /* Pack the data. */ data->iter_data = iter->data; iter->data = data; + + scene_objects_iterator_skip_invalid_flag(iter); } void BKE_scene_objects_iterator_end_ex(struct BLI_Iterator *iter) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: bf-blender [62875] trunk/lib/resources/icon_geom.blend: Curves Sculpting: Snake Hook + Tweaks to Grow
Revision: 62875 https://developer.blender.org/rBL62875 Author: dfelinto Date: 2022-04-11 15:04:33 +0200 (Mon, 11 Apr 2022) Log Message: --- Curves Sculpting: Snake Hook + Tweaks to Grow Differential Review: https://developer.blender.org/D14616 Modified Paths: -- trunk/lib/resources/icon_geom.blend Modified: trunk/lib/resources/icon_geom.blend === (Binary files differ) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [20846596b5a] master: Curves Sculpting Icons: Snake Hook and Grow updates
Commit: 20846596b5a9c9f834ead780dd88bc9eb8c650e9 Author: Dalai Felinto Date: Mon Apr 11 15:09:54 2022 +0200 Branches: master https://developer.blender.org/rB20846596b5a9c9f834ead780dd88bc9eb8c650e9 Curves Sculpting Icons: Snake Hook and Grow updates This implements the icon for snake hook, as well as tweak the growth brush to make it bigger and with the triangles more distinct for better reading of the icon. Differential Revision: https://developer.blender.org/D14616 === M release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat A release/datafiles/icons/ops.curves.sculpt_snake_hook.dat M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat b/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat index 9b3453085e4..13f19185030 100644 Binary files a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat and b/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat b/release/datafiles/icons/ops.curves.sculpt_snake_hook.dat similarity index 53% copy from release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat copy to release/datafiles/icons/ops.curves.sculpt_snake_hook.dat index 9b3453085e4..15128701d0a 100644 Binary files a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat and b/release/datafiles/icons/ops.curves.sculpt_snake_hook.dat differ diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 8fca0c46c82..fb6621c846d 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -777,6 +777,7 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.curves.sculpt_cut ops.curves.sculpt_delete ops.curves.sculpt_grow_shrink + ops.curves.sculpt_snake_hook ops.generic.cursor ops.generic.select ops.generic.select_box ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [bb6d0165b40] tracking_tools: Curves Sculpting Icons: Snake Hook and Grow updates
Commit: bb6d0165b40ebaf06c3ba8820e645d0a4abe7bbf Author: Dalai Felinto Date: Mon Apr 11 15:09:54 2022 +0200 Branches: tracking_tools https://developer.blender.org/rBbb6d0165b40ebaf06c3ba8820e645d0a4abe7bbf Curves Sculpting Icons: Snake Hook and Grow updates This implements the icon for snake hook, as well as tweak the growth brush to make it bigger and with the triangles more distinct for better reading of the icon. Differential Revision: https://developer.blender.org/D14616 === M release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat A release/datafiles/icons/ops.curves.sculpt_snake_hook.dat M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat b/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat index 9b3453085e4..13f19185030 100644 Binary files a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat and b/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat differ diff --git a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat b/release/datafiles/icons/ops.curves.sculpt_snake_hook.dat similarity index 53% copy from release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat copy to release/datafiles/icons/ops.curves.sculpt_snake_hook.dat index 9b3453085e4..15128701d0a 100644 Binary files a/release/datafiles/icons/ops.curves.sculpt_grow_shrink.dat and b/release/datafiles/icons/ops.curves.sculpt_snake_hook.dat differ diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 8fca0c46c82..fb6621c846d 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -777,6 +777,7 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.curves.sculpt_cut ops.curves.sculpt_delete ops.curves.sculpt_grow_shrink + ops.curves.sculpt_snake_hook ops.generic.cursor ops.generic.select ops.generic.select_box ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cf5d582b77f] master: Fix T97207: Move to Collections Menu Grayed out when in Local View
Commit: cf5d582b77fbb7bf392a94248228846bfb774a15 Author: Dalai Felinto Date: Wed Apr 13 12:22:35 2022 +0200 Branches: master https://developer.blender.org/rBcf5d582b77fbb7bf392a94248228846bfb774a15 Fix T97207: Move to Collections Menu Grayed out when in Local View This behaviour was introduced in a687d98e6782 to bring the old obscure "M" operator to remove objects from the local view. In order to avoid the keymap clash with the Move to Collection operator, the Move to Collection was artificially restricted to work in local view. In retrospect, the "Remove from Local View" operator is in the menu anyways, so it didn't even need to have a shortcut (back in 2.79 the operator was not in a menu). The changes introduced here are: * No shortcut for "Remove from Local View" * No more restrictions to "Move/Link to Collection" from local view. Thanks for Philipp Oeser for digging the old commit that introduced this and for the rationale on the changes. === M release/scripts/presets/keyconfig/keymap_data/blender_default.py M source/blender/editors/object/object_edit.c === diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index a1913945364..be6ea28e72e 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -1387,7 +1387,6 @@ def km_view3d(params): ("view3d.localview", {"type": 'NUMPAD_SLASH', "value": 'PRESS'}, None), ("view3d.localview", {"type": 'SLASH', "value": 'PRESS'}, None), ("view3d.localview", {"type": 'MOUSESMARTZOOM', "value": 'ANY'}, None), -("view3d.localview_remove_from", {"type": 'M', "value": 'PRESS'}, None), # Navigation. ("view3d.rotate", {"type": 'MOUSEROTATE', "value": 'ANY'}, None), *(( diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index cc8644285c0..2518b2d201d 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1828,13 +1828,6 @@ static bool move_to_collection_poll(bContext *C) if (CTX_wm_space_outliner(C) != NULL) { return ED_outliner_collections_editor_poll(C); } - - View3D *v3d = CTX_wm_view3d(C); - - if (v3d && v3d->localvd) { -return false; - } - return ED_operator_objectmode(C); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [babd027faef] master: Cleanup: make format
Commit: babd027faef947ae0417f3d2e61ec8188c823ad2 Author: Dalai Felinto Date: Wed Apr 13 12:30:29 2022 +0200 Branches: master https://developer.blender.org/rBbabd027faef947ae0417f3d2e61ec8188c823ad2 Cleanup: make format === M source/blender/blenloader/intern/versioning_defaults.c === diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index cec6d520af3..f65976ee55f 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -533,7 +533,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) /* Match default for new meshes. */ mesh->smoothresh = DEG2RADF(30); /* Match voxel remesher options for all existing meshes in templates. */ -mesh->flag |= ME_REMESH_REPROJECT_VOLUME | ME_REMESH_REPROJECT_PAINT_MASK | ME_REMESH_REPROJECT_SCULPT_FACE_SETS | ME_REMESH_REPROJECT_VERTEX_COLORS; +mesh->flag |= ME_REMESH_REPROJECT_VOLUME | ME_REMESH_REPROJECT_PAINT_MASK | + ME_REMESH_REPROJECT_SCULPT_FACE_SETS | ME_REMESH_REPROJECT_VERTEX_COLORS; /* For Sculpting template. */ if (app_template && STREQ(app_template, "Sculpting")) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [fb84408aa5a] master: Cleanup: Update icons_geom CMakeLists.txt
Commit: fb84408aa5abd01dd803a5497fd5b55ef10c7aa2 Author: Dalai Felinto Date: Wed Apr 13 15:18:16 2022 +0200 Branches: master https://developer.blender.org/rBfb84408aa5abd01dd803a5497fd5b55ef10c7aa2 Cleanup: Update icons_geom CMakeLists.txt === M source/blender/editors/datafiles/CMakeLists.txt === diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index fb6621c846d..9e7e00d5656 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -767,9 +767,9 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.armature.extrude_cursor ops.armature.extrude_move ops.curve.draw - ops.curve.pen ops.curve.extrude_cursor ops.curve.extrude_move + ops.curve.pen ops.curve.radius ops.curve.vertex_random ops.curves.sculpt_add @@ -848,8 +848,8 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES ops.sculpt.border_hide ops.sculpt.border_mask ops.sculpt.box_trim - ops.sculpt.color_filter ops.sculpt.cloth_filter + ops.sculpt.color_filter ops.sculpt.face_set_edit ops.sculpt.lasso_face_set ops.sculpt.lasso_mask ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4fa3eadce99] master: Icons: Re-sync Blender with latest svn icon file
Commit: 4fa3eadce99a87de90b8119e49cfd8ccba56c305 Author: Dalai Felinto Date: Thu Apr 14 09:57:15 2022 +0200 Branches: master https://developer.blender.org/rB4fa3eadce99a87de90b8119e49cfd8ccba56c305 Icons: Re-sync Blender with latest svn icon file There are no real difference from the previous icons, but since some manual changes were introduced in the icons file, we still needed a final sync between them. === M release/datafiles/icons/brush.sculpt.displacement_smear.dat M release/datafiles/icons/brush.sculpt.draw_sharp.dat === diff --git a/release/datafiles/icons/brush.sculpt.displacement_smear.dat b/release/datafiles/icons/brush.sculpt.displacement_smear.dat index 5d422130ea3..9e4df45b2d2 100644 Binary files a/release/datafiles/icons/brush.sculpt.displacement_smear.dat and b/release/datafiles/icons/brush.sculpt.displacement_smear.dat differ diff --git a/release/datafiles/icons/brush.sculpt.draw_sharp.dat b/release/datafiles/icons/brush.sculpt.draw_sharp.dat index 1877c0ae4d4..9bea1b02894 100644 Binary files a/release/datafiles/icons/brush.sculpt.draw_sharp.dat and b/release/datafiles/icons/brush.sculpt.draw_sharp.dat differ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a2ee2d8] multiview: Merge remote-tracking branch 'origin/master' into multiview
Commit: a2ee2d866f9d95c840568193fb1d26f850718fee Author: Dalai Felinto Date: Fri Jan 16 19:15:15 2015 -0200 Branches: multiview https://developer.blender.org/rBa2ee2d866f9d95c840568193fb1d26f850718fee Merge remote-tracking branch 'origin/master' into multiview === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [55d7595] multiview: Movie Writing: changes to encapsulate the elements (as oppose to have everything static)
Commit: 55d75953ce05bb13e5669b9d5096a97917ddee03 Author: Dalai Felinto Date: Fri Jan 16 15:40:22 2015 -0200 Branches: multiview https://developer.blender.org/rB55d75953ce05bb13e5669b9d5096a97917ddee03 Movie Writing: changes to encapsulate the elements (as oppose to have everything static) You can now export individual streams of videos (e.g., Movie_L.mov, Movie_R.mov) safely! =) Before that not only were the names clashing (as I initially thought) but in fact the whole video streaming was mixed up (when you had to export more than one video simultaneously). The way to solve this is to *stop* using static elements and to create a context to store the current movie data. This commits involves a lot of changes, but I believe things are working well. In fact the way I was handling MovieHandler was wrong (creating arrays and all that), so I'm really glad I got to this. Note: I couldn't test Frameserver, in fact test with the general codecs (using multiview or not) are appreciated. Thanks for Sergey Sharybin for the suggestions that lead to this solution. === M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/editors/render/render_opengl.c M source/blender/editors/screen/screendump.c M source/blender/quicktime/apple/qtkit_export.m M source/blender/quicktime/quicktime_export.h M source/blender/render/extern/include/RE_pipeline.h M source/blender/render/intern/include/render_types.h M source/blender/render/intern/source/pipeline.c === diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h index 4a1de0f..680506a 100644 --- a/source/blender/blenkernel/BKE_writeavi.h +++ b/source/blender/blenkernel/BKE_writeavi.h @@ -43,16 +43,19 @@ struct ReportList; struct Scene; typedef struct bMovieHandle { - int (*start_movie)(struct Scene *scene, struct RenderData *rd, int rectx, int recty, const char *suffix, struct ReportList *reports); - int (*append_movie)(struct RenderData *rd, int start_frame, int frame, int *pixels, + int (*start_movie)(void *context_v, struct Scene *scene, struct RenderData *rd, int rectx, int recty, const char *suffix, struct ReportList *reports); + int (*append_movie)(void *context_v, struct RenderData *rd, int start_frame, int frame, int *pixels, int rectx, int recty, const char *suffix, struct ReportList *reports); - void (*end_movie)(void); - int (*get_next_frame)(struct RenderData *rd, struct ReportList *reports); /* optional */ + void (*end_movie)(void *context_v); + int (*get_next_frame)(void *context_v, struct RenderData *rd, struct ReportList *reports); /* optional */ void (*get_movie_path)(char *string, struct RenderData *rd, const char *suffix); /* optional */ + void *(*context_create)(void); + void (*context_free)(void *context_v); } bMovieHandle; bMovieHandle *BKE_movie_handle_get(const char imtype); void BKE_movie_filepath_get(char *string, struct RenderData *rd, const char *suffix); +void BKE_context_create(bMovieHandle *mh); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index 2052c87..4f4d5de 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -69,9 +69,9 @@ struct RenderData; struct ReportList; struct Scene; -int BKE_ffmpeg_start(struct Scene *scene, struct RenderData *rd, int rectx, int recty, const char *suffix, struct ReportList *reports); -void BKE_ffmpeg_end(void); -int BKE_ffmpeg_append(struct RenderData *rd, int start_frame, int frame, int *pixels, +int BKE_ffmpeg_start(void *context_v, struct Scene *scene, struct RenderData *rd, int rectx, int recty, const char *suffix, struct ReportList *reports); +void BKE_ffmpeg_end(void *context_v); +int BKE_ffmpeg_append(void *context_v, struct RenderData *rd, int start_frame, int frame, int *pixels, int rectx, int recty, const char *suffix, struct ReportList *reports); void BKE_ffmpeg_filepath_get(char *string, struct RenderData *rd, const char *suffix); @@ -83,6 +83,9 @@ bool BKE_ffmpeg_alpha_channel_is_supported(struct RenderData *rd); int BKE_ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str); void BKE_ffmpeg_property_del(struct RenderData *rd, void *type, void *prop_); +void *BKE_ffmpeg_context_create(void); +void BKE_ffmpeg_context_free(void *context_v); + #ifdef __cplusplus } #endif di
[Bf-blender-cvs] [c7b00b9] experimental-build: Merge remote-tracking branch 'origin/master' into experimental-build
Commit: c7b00b9fd44252d219761d91748b052d19516f5f Author: Dalai Felinto Date: Fri Jan 16 19:30:07 2015 -0200 Branches: experimental-build https://developer.blender.org/rBc7b00b9fd44252d219761d91748b052d19516f5f Merge remote-tracking branch 'origin/master' into experimental-build === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [52a23ef] experimental-build: Revert "Multiview, squash test"
Commit: 52a23ef97287ba26d8455d44360a04a2aa6ebd00 Author: Dalai Felinto Date: Fri Jan 16 19:31:18 2015 -0200 Branches: experimental-build https://developer.blender.org/rB52a23ef97287ba26d8455d44360a04a2aa6ebd00 Revert "Multiview, squash test" This reverts commit ef4e842abba80d5cce66ff3178c014d8c5fcf97f. === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M source/blender/edit
[Bf-blender-cvs] [ef4e842] experimental-build: Multiview, squash test
Commit: ef4e842abba80d5cce66ff3178c014d8c5fcf97f Author: Dalai Felinto Date: Fri Jan 16 19:30:28 2015 -0200 Branches: experimental-build https://developer.blender.org/rBef4e842abba80d5cce66ff3178c014d8c5fcf97f Multiview, squash test (I want to see if everything builds fine after my last changes to the video exporting system) === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M source
[Bf-blender-cvs] [7095b95] multiview: Fix some building issues (hopefully)
Commit: 7095b9555e002e799d9de9e0cd980001cdff6f95 Author: Dalai Felinto Date: Fri Jan 16 19:56:43 2015 -0200 Branches: multiview https://developer.blender.org/rB7095b9555e002e799d9de9e0cd980001cdff6f95 Fix some building issues (hopefully) === M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c === diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index eef0faf..05cde66 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -181,17 +181,15 @@ static void filepath_avi(char *string, RenderData *rd, const char *suffix) BLI_path_view(string, suffix); } -static int start_avi(void *context_v, Scene *scene, RenderData *rd, int rectx, int recty, const char *suffix, ReportList *reports) +static int start_avi(void *context_v, Scene *UNUSED(scene), RenderData *rd, int rectx, int recty, const char *suffix, ReportList *reports) { int x, y; char name[256]; AviFormat format; int quality; double framerate; - - (void)scene; /* unused */ AviMovie *avi = context_v; - + filepath_avi(name, rd, suffix); x = rectx; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index a8a79cf..f08cf9d 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -215,7 +215,7 @@ static int write_audio_frame(FFMpegContext *context) #endif // #ifdef WITH_AUDASPACE /* Allocate a temporary frame */ -static AVFrame *alloc_picture(FFMpegContext *context, int pix_fmt, int width, int height) +static AVFrame *alloc_picture(int pix_fmt, int width, int height) { AVFrame *f; uint8_t *buf; @@ -362,7 +362,7 @@ static AVFrame *generate_video_frame(FFMpegContext *context, uint8_t *pixels, Re AVFrame *rgb_frame; if (c->pix_fmt != PIX_FMT_BGR32) { - rgb_frame = alloc_picture(context, PIX_FMT_BGR32, width, height); + rgb_frame = alloc_picture(PIX_FMT_BGR32, width, height); if (!rgb_frame) { BKE_report(reports, RPT_ERROR, "Could not allocate temporary frame"); return NULL; @@ -657,7 +657,7 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int } av_dict_free(&opts); - context->current_frame = alloc_picture(context, c->pix_fmt, c->width, c->height); + context->current_frame = alloc_picture(c->pix_fmt, c->width, c->height); context->img_convert_ctx = sws_getContext(c->width, c->height, PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e8a2382] experimental-build: Revert "See if multiview is building fine"
Commit: e8a2382782e456f0454c2f784764f0c9529bda95 Author: Dalai Felinto Date: Fri Jan 16 20:01:08 2015 -0200 Branches: experimental-build https://developer.blender.org/rBe8a2382782e456f0454c2f784764f0c9529bda95 Revert "See if multiview is building fine" This reverts commit f46c8377eb374014376d0da43d5e0a7fbcc5b700. === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M sour
[Bf-blender-cvs] [f46c837] experimental-build: See if multiview is building fine
Commit: f46c8377eb374014376d0da43d5e0a7fbcc5b700 Author: Dalai Felinto Date: Fri Jan 16 20:00:58 2015 -0200 Branches: experimental-build https://developer.blender.org/rBf46c8377eb374014376d0da43d5e0a7fbcc5b700 See if multiview is building fine === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M source/blender/editors/render/render_shading.c M source/blender/editors/screen/area.c M
[Bf-blender-cvs] [4c05067] multiview: Sequencer Proxy: Image - Avoid creating unecessary proxy image files
Commit: 4c050676e8d9596e4d1739a37b0b503f6a22486b Author: Dalai Felinto Date: Wed Jan 21 15:24:14 2015 -0200 Branches: multiview https://developer.blender.org/rB4c050676e8d9596e4d1739a37b0b503f6a22486b Sequencer Proxy: Image - Avoid creating unecessary proxy image files === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 6dbe441..f650a45 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -53,6 +53,12 @@ #include "BLI_threads.h" #include "BLI_utildefines.h" +#ifdef WIN32 +# include "BLI_winstuff.h" +#else +# include +#endif + #include "BLF_translation.h" #include "BKE_animsys.h" @@ -1668,6 +1674,41 @@ static void seq_proxy_build_frame(const SeqRenderData *context, Sequence *seq, i IMB_freeImBuf(ibuf); } +/* returns whether the file this context would read from even exist, if not, don't create the context +*/ +static bool seq_proxy_multiview_context_invalid(Sequence *seq, Scene *scene, const size_t view_id) +{ + if ((scene->r.scemode & R_MULTIVIEW) == 0) + return false; + + if ((seq->type == SEQ_TYPE_IMAGE) && (seq->views_format == R_IMF_VIEWS_INDIVIDUAL)) { + static char prefix[FILE_MAX] = {'\0'}; + static char *ext = NULL; + char str[FILE_MAX] = {'\0'}; + + if (view_id == 0) { + char path[FILE_MAX]; + BLI_join_dirfile(path, sizeof(path), seq->strip->dir, +seq->strip->stripdata->name); + BLI_path_abs(path, G.main->name); + BKE_scene_view_prefix_get(scene, path, prefix, &ext); + } + + if (prefix[0] == '\0') + return view_id != 0; + + seq_multiview_name(scene, view_id, prefix, ext, str, FILE_MAX); + + if (BLI_access(str, R_OK) == 0) + return false; + else + return view_id != 0; + } + return false; +} + +/** This returns the maximum possible number of required contexts +*/ static size_t seq_proxy_context_count(Sequence *seq, Scene *scene) { size_t num_views = 1; @@ -1722,6 +1763,9 @@ void BKE_sequencer_proxy_rebuild_context(Main *bmain, Scene *scene, Sequence *se num_files = seq_proxy_context_count(seq, scene); for (i = 0; i < num_files; i++) { + if (seq_proxy_multiview_context_invalid(seq, scene, i)) + continue; + context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context"); nseq = BKE_sequence_dupli_recursive(scene, scene, seq, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [11cb2ab] multiview: Small refactor using BKE_scene_view_id_suffix_get()
Commit: 11cb2ab91943137e0fc1d2cd5d2b545ab97afca9 Author: Dalai Felinto Date: Mon Jan 19 18:43:02 2015 -0200 Branches: multiview https://developer.blender.org/rB11cb2ab91943137e0fc1d2cd5d2b545ab97afca9 Small refactor using BKE_scene_view_id_suffix_get() === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 0451beb..2caf2b7 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -787,9 +787,7 @@ void BKE_sequence_calc(Scene *scene, Sequence *seq) static void seq_multiview_name(Scene *scene, const size_t view_id, const char *prefix, const char *ext, char *r_path, size_t r_size) { - const char *viewname = BKE_scene_render_view_name_get(&scene->r, view_id); - const char *suffix = BKE_scene_view_suffix_get(&scene->r, viewname); - + const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, view_id); BLI_snprintf(r_path, r_size, "%s%s%s", prefix, suffix, ext); } @@ -1453,8 +1451,7 @@ static void seq_open_anim_file(Scene *scene, Sequence *seq) goto monoview; for (i = 0; i < totfiles; i++) { - const char *viewname = BKE_scene_render_view_name_get(&scene->r, i); - const char *suffix = BKE_scene_view_suffix_get(&scene->r, viewname); + const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, i); char str[FILE_MAX] = {'\0'}; StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2e207f9] multiview: Sequencer Proxy: movies sequences in a working state, aka everything working
Commit: 2e207f9154d2e9714f34d03d4b27a72ed7db26a6 Author: Dalai Felinto Date: Wed Jan 21 14:02:06 2015 -0200 Branches: multiview https://developer.blender.org/rB2e207f9154d2e9714f34d03d4b27a72ed7db26a6 Sequencer Proxy: movies sequences in a working state, aka everything working Proxies in the Sequencer are fully working with Multiview. The code can be cleaned up a bit, but at least it's entirely functional. Note, for images we generate one proxy image per view (per frame), while for movies we generate one proxy movie per movie (so an anaglyph movie will generate only one proxy). Tested cases: * Image sequence - mono * Image sequence - 3d top-bottom encoded * Image sequence - 3d left-right pair * Movie sequence - mono * Movie sequence - 3d top-bottom encoded * Movie sequence - 3d left-right pair === M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/intern/sequencer.c M source/blender/editors/space_sequencer/sequencer_edit.c M source/blender/imbuf/IMB_imbuf.h M source/blender/imbuf/intern/IMB_anim.h M source/blender/imbuf/intern/anim_movie.c M source/blender/imbuf/intern/indexer.c === diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 17a0b4c..c698f9f 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -239,7 +239,7 @@ struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra); void BKE_sequencer_update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change); bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, struct Sequence *seq, float cfra); -struct SeqIndexBuildContext *BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq); +void BKE_sequencer_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq, ListBase *queue); void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context, short *stop, short *do_update, float *progress); void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 2caf2b7..6dbe441 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -89,6 +89,7 @@ static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, floa static void seq_free_animdata(Scene *scene, Sequence *seq); static ImBuf *seq_render_mask(const SeqRenderData *context, Mask *mask, float nr, bool make_float); static size_t seq_num_files(Scene *scene, char views_format); +static void seq_anim_add_suffix(Scene *scene, struct anim *anim, const size_t view_id); /* XXX */ #define SELECT 1 @@ -855,6 +856,8 @@ void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, const bool lock_r seq_multiview_name(scene, i, prefix, ext, str, FILE_MAX); anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), seq->streamindex, seq->strip->colorspace_settings.name); + seq_anim_add_suffix(scene, anim, i); + if (anim) { sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); BLI_addtail(&seq->anims, sanim); @@ -1358,6 +1361,7 @@ typedef struct SeqIndexBuildContext { int tc_flags; int size_flags; int quality; + size_t view_id; Main *bmain; Scene *scene; @@ -1453,14 +1457,15 @@ static void seq_open_anim_file(Scene *scene, Sequence *seq) for (i = 0; i < totfiles; i++) { const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, i); char str[FILE_MAX] = {'\0'}; - StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); + BLI_addtail(&seq->anims, sanim); BLI_snprintf(str, sizeof(str), "%s%s%s", prefix, suffix, ext); sanim->anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), seq->streamindex, seq->strip->colorspace_settings.name); + seq_anim_add_suffix(scene, sanim->anim, i); if (sanim->anim == NULL) {
[Bf-blender-cvs] [2da034d] multiview: Merge remote-tracking branch 'origin/master' into multiview
Commit: 2da034db2fa9695c6adc64e8d48147a0d0c53cbb Author: Dalai Felinto Date: Wed Jan 21 16:28:49 2015 -0200 Branches: multiview https://developer.blender.org/rB2da034db2fa9695c6adc64e8d48147a0d0c53cbb Merge remote-tracking branch 'origin/master' into multiview Conflicts: intern/cycles/blender/addon/ui.py source/blender/makesrna/intern/rna_space.c === === diff --cc intern/cycles/blender/addon/ui.py index 43fd309,da303ce..afdcc13 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@@ -1464,7 -1417,7 +1464,8 @@@ def get_panels() "DATA_PT_vertex_colors", "DATA_PT_camera", "DATA_PT_camera_display", +"DATA_PT_camera_stereoscopy", + "DATA_PT_camera_safe_areas", "DATA_PT_lens", "DATA_PT_speaker", "DATA_PT_distance", diff --cc source/blender/blenloader/intern/versioning_270.c index 807320e,c652f56..acd8edc --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@@ -464,104 -457,75 +464,174 @@@ void blo_do_versions_270(FileData *fd, #undef BRUSH_RAKE #undef BRUSH_RANDOM_ROTATION + + /* MV before merge: add a MAIN_VERSION_ATLEAST check */ + { + if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "ListBase", "views")) { + Scene *scene; + SceneRenderView *srv; + for (scene = main->scene.first; scene; scene = scene->id.next) { + BKE_scene_add_render_view(scene, STEREO_LEFT_NAME); + srv = (SceneRenderView *)scene->r.views.first; + BLI_strncpy(srv->suffix, "_L", sizeof(srv->suffix)); + + BKE_scene_add_render_view(scene, STEREO_RIGHT_NAME); + srv = (SceneRenderView *)scene->r.views.last; + BLI_strncpy(srv->suffix, "_R", sizeof(srv->suffix)); + } + } + + if (!DNA_struct_elem_find(fd->filesdna, "View3D", "char", "stereo_camera")) { + bScreen *screen; + for (screen = main->screen.first; screen; screen = screen->id.next) { + ScrArea *sa; + for (sa = screen->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + + for (sl = sa->spacedata.first; sl; sl = sl->next) { + switch (sl->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d = (View3D *)sl; + v3d->stereo3d_camera = STEREO_3D_ID; + v3d->stereo3d_flag |= V3D_S3D_DISPPLANE; + v3d->stereo3d_convergence_alpha = 0.15f; + v3d->stereo3d_volume_alpha = 0.05f; + break; + } + case SPACE_IMAGE: + { + SpaceImage *sima = (SpaceImage *) sl; + sima->iuser.flag |= IMA_SHOW_STEREO; + sima->iuser.passtype = SCE_PASS_COMBINED; + break; + } + } + } + } + } + } + + if (!DNA_struct_elem_find(fd->filesdna, "Camera", "CameraStereoSettings", "stereo")) { + Camera *cam; + for (cam = main->camera.first; cam; cam = cam->id.next) { + cam->stereo.interocular_distance = 0.065; + cam->stereo.convergence_distance = 30.f * 0.065; +
[Bf-blender-cvs] [fc9622a] multiview: Sequencer Proxy: Images - add the view suffix only when view_id > 0
Commit: fc9622a16700fc40ab163ac3b862dc93eb3bd2a5 Author: Dalai Felinto Date: Wed Jan 21 16:16:03 2015 -0200 Branches: multiview https://developer.blender.org/rBfc9622a16700fc40ab163ac3b862dc93eb3bd2a5 Sequencer Proxy: Images - add the view suffix only when view_id > 0 This way proxies created for monoscopic image strips created in previous Blenders work out of the box === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index f650a45..1a3bb36 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1514,6 +1514,7 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char * { int frameno; char dir[PROXY_MAXFILE]; + char suffix[24] = {'\0'}; if (!seq->strip->proxy) { return false; @@ -1537,11 +1538,14 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char * return false; } + if (view_id > 0) + BLI_snprintf(suffix, sizeof(suffix), "_%zu", view_id); + if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { BLI_join_dirfile(name, PROXY_MAXFILE, dir, seq->strip->proxy->file); BLI_path_abs(name, G.main->name); - BLI_snprintf(name, PROXY_MAXFILE, "%s_%zu", name, view_id); + BLI_snprintf(name, PROXY_MAXFILE, "%s_%s", name, suffix); return true; } @@ -1549,13 +1553,13 @@ static bool seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char * /* generate a separate proxy directory for each preview size */ if (seq->type == SEQ_TYPE_IMAGE) { - BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy_%zu", dir, render_size, -BKE_sequencer_give_stripelem(seq, cfra)->name, view_id); + BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy%s", dir, render_size, +BKE_sequencer_give_stripelem(seq, cfra)->name, suffix); frameno = 1; } else { frameno = (int)give_stripelem_index(seq, cfra) + seq->anim_startofs; - BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/_%zu", dir, render_size, view_id); + BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/%s", dir, render_size, suffix); } BLI_path_abs(name, G.main->name); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6ea7901] experimental-build: Merge remote-tracking branch 'origin/master' into experimental-build
Commit: 6ea79012653128b8a072d37fa326b000a220a215 Author: Dalai Felinto Date: Wed Jan 21 16:39:14 2015 -0200 Branches: experimental-build https://developer.blender.org/rB6ea79012653128b8a072d37fa326b000a220a215 Merge remote-tracking branch 'origin/master' into experimental-build === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e919486] experimental-build: Revert "Multiview: squashed"
Commit: e919486082e4211b58f43b02031c9d091d3d Author: Dalai Felinto Date: Wed Jan 21 16:40:37 2015 -0200 Branches: experimental-build https://developer.blender.org/rBe919486082e4211b58f43b02031c9d091d3d Revert "Multiview: squashed" This reverts commit e12f4a0657c19c83094df02585b1725f75f2e07f. === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.cpp D source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp D source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M source/blender/edit
[Bf-blender-cvs] [e12f4a0] experimental-build: Multiview: squashed
Commit: e12f4a0657c19c83094df02585b1725f75f2e07f Author: Dalai Felinto Date: Wed Jan 21 16:40:31 2015 -0200 Branches: experimental-build https://developer.blender.org/rBe12f4a0657c19c83094df02585b1725f75f2e07f Multiview: squashed === M intern/cycles/blender/addon/ui.py M intern/cycles/blender/blender_camera.cpp M intern/cycles/blender/blender_session.cpp M intern/cycles/blender/blender_session.h M release/scripts/startup/bl_ui/properties_data_camera.py M release/scripts/startup/bl_ui/properties_render.py M release/scripts/startup/bl_ui/properties_render_layer.py M release/scripts/startup/bl_ui/space_image.py M release/scripts/startup/bl_ui/space_info.py M release/scripts/startup/bl_ui/space_sequencer.py M release/scripts/startup/bl_ui/space_view3d.py M release/scripts/startup/nodeitems_builtins.py M source/blender/blenkernel/BKE_camera.h M source/blender/blenkernel/BKE_image.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_scene.h M source/blender/blenkernel/BKE_sequencer.h M source/blender/blenkernel/BKE_writeavi.h M source/blender/blenkernel/BKE_writeffmpeg.h M source/blender/blenkernel/BKE_writeframeserver.h M source/blender/blenkernel/intern/bpath.c M source/blender/blenkernel/intern/camera.c M source/blender/blenkernel/intern/image.c M source/blender/blenkernel/intern/node.c M source/blender/blenkernel/intern/ocean.c M source/blender/blenkernel/intern/packedFile.c M source/blender/blenkernel/intern/scene.c M source/blender/blenkernel/intern/seqcache.c M source/blender/blenkernel/intern/sequencer.c M source/blender/blenkernel/intern/writeavi.c M source/blender/blenkernel/intern/writeffmpeg.c M source/blender/blenkernel/intern/writeframeserver.c M source/blender/blenlib/BLI_path_util.h M source/blender/blenlib/BLI_threads.h M source/blender/blenlib/intern/path_util.c M source/blender/blenlib/intern/threads.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_270.c M source/blender/blenloader/intern/writefile.c M source/blender/collada/ImageExporter.cpp M source/blender/compositor/CMakeLists.txt M source/blender/compositor/COM_compositor.h M source/blender/compositor/intern/COM_CompositorContext.h M source/blender/compositor/intern/COM_Converter.cpp M source/blender/compositor/intern/COM_ExecutionSystem.cpp M source/blender/compositor/intern/COM_ExecutionSystem.h M source/blender/compositor/intern/COM_Node.cpp M source/blender/compositor/intern/COM_compositor.cpp M source/blender/compositor/nodes/COM_CompositorNode.cpp M source/blender/compositor/nodes/COM_ImageNode.cpp M source/blender/compositor/nodes/COM_ImageNode.h M source/blender/compositor/nodes/COM_OutputFileNode.cpp M source/blender/compositor/nodes/COM_RenderLayersNode.cpp M source/blender/compositor/nodes/COM_SplitViewerNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.cpp A source/blender/compositor/nodes/COM_SwitchViewNode.h M source/blender/compositor/nodes/COM_ViewerNode.cpp M source/blender/compositor/operations/COM_CompositorOperation.cpp M source/blender/compositor/operations/COM_CompositorOperation.h M source/blender/compositor/operations/COM_ImageOperation.cpp M source/blender/compositor/operations/COM_ImageOperation.h M source/blender/compositor/operations/COM_MultilayerImageOperation.cpp M source/blender/compositor/operations/COM_MultilayerImageOperation.h A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp A source/blender/compositor/operations/COM_OutputFileMultiViewOperation.h M source/blender/compositor/operations/COM_OutputFileOperation.cpp M source/blender/compositor/operations/COM_OutputFileOperation.h M source/blender/compositor/operations/COM_RenderLayersProg.cpp M source/blender/compositor/operations/COM_RenderLayersProg.h M source/blender/compositor/operations/COM_ViewerOperation.cpp M source/blender/compositor/operations/COM_ViewerOperation.h M source/blender/editors/include/ED_view3d.h M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_ops.c M source/blender/editors/object/object_bake_api.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_internal.c M source/blender/editors/render/render_opengl.c M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_preview.c M source/blender/editors/render/render_shading.c M source/blender/editors/screen/area.c M source
[Bf-blender-cvs] [8ed439b] master: bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE
Commit: 8ed439b89ed4f4c968c90f8074bb0925f79cee80 Author: Dalai Felinto Date: Thu Jan 22 02:42:40 2015 -0200 Branches: master https://developer.blender.org/rB8ed439b89ed4f4c968c90f8074bb0925f79cee80 bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE This function allows the user to run specific code for each of the rendered stereoscopic eyes in the Game Engine. The initial use case is to set the camera projection matrix in a scene.pre_draw callback function for each eye, to be used in VR (Virtual Reality) installations. Reviewed by Mitchell Stokes and Campbell Barton, thank you guys. Sample Test Python Script: """ import bge import bgl import blf def init(): """init function - runs once""" scene = bge.logic.getCurrentScene() scene.post_draw.append(write) def write(): """write on screen - depending on the eye""" width = bge.render.getWindowWidth() height = bge.render.getWindowHeight() # OpenGL setup bgl.glMatrixMode(bgl.GL_PROJECTION) bgl.glLoadIdentity() bgl.gluOrtho2D(0, width, 0, height) bgl.glMatrixMode(bgl.GL_MODELVIEW) bgl.glLoadIdentity() eye = bge.render.getStereoEye() if eye == bge.render.LEFT_EYE: blf.position(0, (width * 0.2), (height * 0.3), 0) blf.size(0, 40, 72) blf.draw(0, "Left") else: # bge.render.RIGHT_EYE: blf.position(0, (width * 0.7), (height * 0.3), 0) blf.size(0, 40, 72) blf.draw(0, "Right") """ === M doc/python_api/rst/bge.render.rst M source/gameengine/Ketsji/KX_PythonInit.cpp === diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst index 9dd4057..03db3bf 100644 --- a/doc/python_api/rst/bge.render.rst +++ b/doc/python_api/rst/bge.render.rst @@ -75,6 +75,14 @@ Constants Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low. +.. data:: LEFT_EYE + + Left eye being used during stereoscopic rendering. + +.. data:: RIGHT_EYE + + Right eye being used during stereoscopic rendering. + * Functions * @@ -217,6 +225,15 @@ Functions :rtype: float +.. function:: getStereoEye() + + Gets the current stereoscopy eye being rendered. + This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback + function to customize the camera projection matrices for each + stereoscopic eye. + + :rtype: LEFT_EYE, RIGHT_EYE + .. function:: setMaterialMode(mode) Set the material mode to use for OpenGL rendering. diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 3ddd53b..348b84e 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1006,6 +1006,21 @@ static PyObject *gPyGetFocalLength(PyObject *, PyObject *, PyObject *) Py_RETURN_NONE; } +static PyObject *gPyGetStereoEye(PyObject *, PyObject *, PyObject *) +{ + int flag = RAS_IRasterizer::RAS_STEREO_LEFTEYE; + + if (!gp_Rasterizer) { + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getStereoEye(), Rasterizer not available"); + return NULL; + } + + if (gp_Rasterizer->Stereo()) + flag = gp_Rasterizer->GetEye(); + + return PyLong_FromLong(flag); +} + static PyObject *gPySetBackgroundColor(PyObject *, PyObject *value) { @@ -1496,6 +1511,7 @@ static struct PyMethodDef rasterizer_methods[] = { {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_NOARGS, "get the eye separation for stereo mode"}, {"setFocalLength", (PyCFunction) gPySetFocalLength, METH_VARARGS, "set the focal length for stereo mode"}, {"getFocalLength", (PyCFunction) gPyGetFocalLength, METH_VARARGS, "get the focal length for stereo mode"}, + {"getStereoEye", (PyCFunction) gPyGetStereoEye, METH_VARARGS, "get the current stereoscopy eye being rendered"}, {"setMaterialMode",(PyCFunction) gPySetMaterialType, METH_VARARGS, "set the material mode to use for OpenGL rendering"}, {"getMaterialMode",(PyCFunction) gPyGetMaterialType, @@ -2320,6 +2336,10 @@ PyObject *initRasterizer(RAS_IRasterizer* rasty,RAS_ICanvas* canvas) KX_MACRO_addTypesToDict(d, VSYNC_ON, VSYNC_ON); KX_MACRO_addTypesToDict(d, VSYNC_ADAPTIVE, VSYNC_ADAPTIVE); + /* stereoscopy */ + KX_MACRO_addTypesToDict(d, LEFT_EYE, RAS_IRasterizer::RAS_STEREO_LEFTEYE); + KX_MACRO_addTypesToDict(d, RIGHT_EYE, RAS_IRasterizer
[Bf-blender-cvs] [5c6ef95] master: Docs: touch ups in the bge.render doc introduction
Commit: 5c6ef95b716b97f4d2bc7902049ecf4451e255fd Author: Dalai Felinto Date: Thu Jan 22 03:20:39 2015 -0200 Branches: master https://developer.blender.org/rB5c6ef95b716b97f4d2bc7902049ecf4451e255fd Docs: touch ups in the bge.render doc introduction === M doc/python_api/rst/bge.render.rst === diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst index 03db3bf..77d5bd7 100644 --- a/doc/python_api/rst/bge.render.rst +++ b/doc/python_api/rst/bge.render.rst @@ -8,9 +8,13 @@ Intro .. module:: bge.render +Example of using a :class:`bge.types.SCA_MouseSensor`, and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook: + +.. note:: + This can also be achieved with the :class:`bge.types.KX_MouseActuator`. + .. code-block:: python - # Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook:: # To use a mouse movement sensor "Mouse" and a # motion actuator to mouse look: import bge ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [7b16fda] master: Fix T43388 Cycles Baking gives different results than Cycles Render
Commit: 7b16fda3799d5b7167ef7ffe533d654810f44e36 Author: Dalai Felinto Date: Tue Jan 27 13:02:55 2015 -0200 Branches: master https://developer.blender.org/rB7b16fda3799d5b7167ef7ffe533d654810f44e36 Fix T43388 Cycles Baking gives different results than Cycles Render Reported and nailed down by Michale (MeshLogic). The code that fixes this was commented out, but Brecht gave the go ahead to use it even if it is not the real solution === M intern/cycles/kernel/kernel_bake.h === diff --git a/intern/cycles/kernel/kernel_bake.h b/intern/cycles/kernel/kernel_bake.h index c6cec48..0379fca 100644 --- a/intern/cycles/kernel/kernel_bake.h +++ b/intern/cycles/kernel/kernel_bake.h @@ -159,7 +159,8 @@ ccl_device bool is_light_pass(ShaderEvalType type) } } -#if 0 +/* this helps with AA but it's not the real solution as it does not AA the geometry + * but it's better than nothing, thus committed */ ccl_device_inline float bake_clamp_mirror_repeat(float u) { /* use mirror repeat (like opengl texture) so that if the barycentric @@ -170,7 +171,6 @@ ccl_device_inline float bake_clamp_mirror_repeat(float u) return (((int)fu) & 1)? 1.0f - u: u; } -#endif ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, ShaderEvalType type, int i, int offset, int sample) @@ -199,8 +199,6 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, /* random number generator */ RNG rng = cmj_hash(offset + i, kernel_data.integrator.seed); - -#if 0 uint rng_state = cmj_hash(i, kernel_data.integrator.seed); float filter_x, filter_y; path_rng_init(kg, &rng_state, sample, num_samples, &rng, 0, 0, &filter_x, &filter_y); @@ -210,7 +208,6 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, u = bake_clamp_mirror_repeat(u + dudx*(filter_x - 0.5f) + dudy*(filter_y - 0.5f)); v = bake_clamp_mirror_repeat(v + dvdx*(filter_x - 0.5f) + dvdy*(filter_y - 0.5f)); } -#endif /* triangle */ int shader; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [34069b7] multiview: Fix missing panels (likely removed in a oerge conflict "fix")
Commit: 34069b71c4fe35f99619ce30f186fd52bde452da Author: Dalai Felinto Date: Wed Feb 4 09:46:22 2015 -0200 Branches: multiview https://developer.blender.org/rB34069b71c4fe35f99619ce30f186fd52bde452da Fix missing panels (likely removed in a oerge conflict "fix") === M release/scripts/startup/bl_ui/space_sequencer.py === diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index ce87ae2..c03f02e 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -1063,6 +1063,23 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel): col.prop(mod, "contrast") +class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel): +bl_space_type = 'SEQUENCE_EDITOR' +bl_region_type = 'UI' + +# NOTE: this is just a wrapper around the generic GP Panel +# But, it should only show up when there are images in the preview region + + +class SEQUENCER_PT_grease_pencil_tools(GreasePencilToolsPanel, SequencerButtonsPanel_Output, Panel): +bl_space_type = 'SEQUENCE_EDITOR' +bl_region_type = 'UI' + +# NOTE: this is just a wrapper around the generic GP tools panel + # It contains access to some essential tools usually found only in + # toolbar, which doesn't exist here... + + class SEQUENCER_PT_stereo_3d(SequencerButtonsPanel, Panel): bl_label = "Stereoscopy" bl_options = {'DEFAULT_CLOSED'} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [ebdedf8] multiview: Merge remote-tracking branch 'origin/master' into multiview
Commit: ebdedf8a9646edf6b4cd5122b601213651c947ec Author: Dalai Felinto Date: Wed Feb 4 11:19:01 2015 -0200 Branches: multiview https://developer.blender.org/rBebdedf8a9646edf6b4cd5122b601213651c947ec Merge remote-tracking branch 'origin/master' into multiview The conflict solving included a change in openexr_api.cpp (to have COMBINED always on head) that I'm not sure I should go ahead with. So this little bit may be reverted later. Conflicts: intern/cycles/blender/blender_camera.cpp source/blender/blenkernel/BKE_sequencer.h source/blender/blenkernel/intern/image.c source/blender/blenkernel/intern/sequencer.c source/blender/blenkernel/intern/writeframeserver.c source/blender/editors/include/ED_view3d.h source/blender/editors/sculpt_paint/paint_image_proj.c source/blender/editors/space_sequencer/sequencer_edit.c source/blender/imbuf/IMB_imbuf_types.h source/blender/imbuf/intern/openexr/openexr_api.cpp source/blender/makesdna/DNA_image_types.h source/blender/makesrna/intern/rna_image.c source/blender/render/intern/source/render_result.c source/blender/windowmanager/intern/wm_files.c === === diff --cc intern/cycles/blender/blender_camera.cpp index f30b992,16f555c..74151c3 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@@ -521,7 -520,26 +525,27 @@@ static void blender_camera_view_subset( *cam_box = cam * (1.0f/cam_aspect); } -static void blender_camera_border_subset(BL::RenderSettings b_render, ++static void blender_camera_border_subset(BL::RenderEngine b_engine, ++ BL::RenderSettings b_render, + BL::Scene b_scene, + BL::SpaceView3D b_v3d, + BL::RegionView3D b_rv3d, + BL::Object b_ob, + int width, int height, + const BoundBox2D &border, + BoundBox2D *result) + { + /* Determine camera viewport subset. */ + BoundBox2D view_box, cam_box; - blender_camera_view_subset(b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height, ++ blender_camera_view_subset(b_engine, b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height, + &view_box, &cam_box); + + /* Determine viewport subset matching given border. */ + cam_box = cam_box.make_relative_to(view_box); + *result = cam_box.subset(border); + } + -static void blender_camera_border(BlenderCamera *bcam, BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d, +static void blender_camera_border(BlenderCamera *bcam, BL::RenderEngine b_engine, BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height) { bool is_camera_view; @@@ -551,20 -566,36 +572,38 @@@ if(!b_ob) return; + /* Determine camera border inside the viewport. */ + BoundBox2D full_border; - blender_camera_border_subset(b_render, ++ blender_camera_border_subset(b_engine, ++ b_render, +b_scene, +b_v3d, +b_rv3d, +b_ob, +width, height, +full_border, +&bcam->viewport_camera_border); + + if(!b_render.use_border()) { + return; + } + bcam->border.left = b_render.border_min_x(); bcam->border.right = b_render.border_max_x(); bcam->border.bottom = b_render.border_min_y(); bcam->border.top = b_render.border_max_y(); - /* determine camera viewport subset */ - BoundBox2D view_box, cam_box; - - blender_camera_view_subset(b_engine, b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height, - &view_box, &cam_box); - - /* determine viewport subset matching camera border */ - cam_box = cam_box.make_relative_to(view_box); - bcam->border = cam_box.subset(bcam->border).clamp(); + /* Determine viewport subset matching camera border. */ - blender_camera_border_subset(b_render, ++ blender_camera_border_subset(b_engine, ++ b_render, +b_scene, +b_v3d, +b_rv3d, +
[Bf-blender-cvs] [089c6d6] multiview: Fix for unfreed memory after bad merge (re: sequencer proxies)
Commit: 089c6d6694fe46c14144fa3786832c6f477edb8f Author: Dalai Felinto Date: Wed Feb 4 17:06:37 2015 -0200 Branches: multiview https://developer.blender.org/rB089c6d6694fe46c14144fa3786832c6f477edb8f Fix for unfreed memory after bad merge (re: sequencer proxies) === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 234320e..cd9e546 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3127,8 +3127,8 @@ monoview_image: proxy_size); /* fetching for requested proxy sze failed, try fetching the original isntead */ - if (!ibuf && proxy_size != IMB_PROXY_NONE) { - ibuf = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs, + if (!ibuf_arr[i] && proxy_size != IMB_PROXY_NONE) { + ibuf_arr[i] = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs, seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, IMB_PROXY_NONE); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [035d14c] master: small typo in a code comment, fixing this before someone does it to prevent uneeded merge conflicts in branches
Commit: 035d14c029d688e21382df978e7379f990c1d653 Author: Dalai Felinto Date: Wed Feb 4 17:19:15 2015 -0200 Branches: master https://developer.blender.org/rB035d14c029d688e21382df978e7379f990c1d653 small typo in a code comment, fixing this before someone does it to prevent uneeded merge conflicts in branches === M source/blender/blenkernel/intern/sequencer.c === diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index dd46fdc..83287fe 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2796,7 +2796,7 @@ static ImBuf *do_render_strip_uncached(const SeqRenderData *context, Sequence *s seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, proxy_size); - /* fetching for requested proxy sze failed, try fetching the original isntead */ + /* fetching for requested proxy size failed, try fetching the original instead */ if (!ibuf && proxy_size != IMB_PROXY_NONE) { ibuf = IMB_anim_absolute(seq->anim, nr + seq->anim_startofs, seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [39037fe] multiview: Merge commit 'origin/master~' into multiview
Commit: 39037fe06c36f2eddc8394018ae561270cfa04e0 Author: Dalai Felinto Date: Wed Feb 4 17:41:39 2015 -0200 Branches: multiview https://developer.blender.org/rB39037fe06c36f2eddc8394018ae561270cfa04e0 Merge commit 'origin/master~' into multiview Conflicts: source/blender/blenkernel/intern/sequencer.c === === diff --cc source/blender/blenkernel/intern/image.c index 8d7ddd4,b130372..230a1c2 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@@ -2273,11 -2102,19 +2273,19 @@@ void BKE_image_path_from_imformat void BKE_image_path_from_imtype( char *string, const char *base, const char *relbase, int frame, -const char imtype, const bool use_ext, const bool use_frames) +const char imtype, const bool use_ext, const bool use_frames, const char *view) { - image_path_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames); + do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames, view); } + struct anim *openanim_noload(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE]) + { + struct anim *anim; + + anim = IMB_open_anim(name, flags, streamindex, colorspace); + return anim; + } + /* used by sequencer too */ struct anim *openanim(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE]) { diff --cc source/blender/blenkernel/intern/sequencer.c index cd9e546,dd46fdc..0689a2a --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@@ -1408,31 -1330,12 +1408,31 @@@ static double seq_rendersize_to_scale_f return 0.25; } -static void seq_open_anim_file(Sequence *seq, bool openfile) +/* the number of files will vary according to the stereo format */ +static size_t seq_num_files(Scene *scene, char views_format) { + const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; + + if (!is_multiview) { + return 1; + } + else if (views_format == R_IMF_VIEWS_STEREO_3D) { + return 1; + } + /* R_IMF_VIEWS_INDIVIDUAL */ + else { + return BKE_scene_num_views_get(&scene->r); + } +} + - static void seq_open_anim_file(Scene *scene, Sequence *seq) ++static void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile) +{ + char dir[FILE_MAX]; char name[FILE_MAX]; StripProxy *proxy; + const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; - if (seq->anim != NULL) { + if ((seq->anims.first != NULL) && (((StripAnim *)seq->anims.first)->anim != NULL)) { return; } @@@ -1442,72 -1342,32 +1442,91 @@@ BLI_join_dirfile(name, sizeof(name), seq->strip->dir, seq->strip->stripdata->name); BLI_path_abs(name, G.main->name); - - if (openfile) { - seq->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); - } - else { - seq->anim = openanim_noload(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); - } - if (seq->anim == NULL) { - return; + proxy = seq->strip->proxy; + + if (proxy && (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { + BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); + BLI_path_abs(dir, G.main->name); } - proxy = seq->strip->proxy; + if (is_multiview && seq->views_format == R_IMF_VIEWS_INDIVIDUAL) { + size_t totfiles = seq_num_files(scene, seq->views_format); + char prefix[FILE_MAX] = {'\0'}; + char *ext = NULL; + int i; - if (proxy == NULL) { - return; + BKE_scene_view_prefix_get(scene, name, prefix, &ext); + + if (prefix[0] == '\0') + goto monoview; + + for (i = 0; i < totfiles; i++) { + const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, i); + char str[FILE_MAX] = {'\0'}; + StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); + + BLI_addtail(&seq->anims, sanim); + + BLI_snprintf(str, sizeof(str), "
[Bf-blender-cvs] [1a87699] multiview: Merge remote-tracking branch 'origin/master' into multiview
Commit: 1a8769917c868154c000de70a7a7cb95666aee6e Author: Dalai Felinto Date: Wed Feb 4 17:43:55 2015 -0200 Branches: multiview https://developer.blender.org/rB1a8769917c868154c000de70a7a7cb95666aee6e Merge remote-tracking branch 'origin/master' into multiview (aka the typo fix commit in master, just to prevent having to solve this conflict if someone else had fixed this first ;) Conflicts: source/blender/blenkernel/intern/sequencer.c === === diff --cc source/blender/blenkernel/intern/sequencer.c index 0689a2a,83287fe..727a154 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@@ -3119,116 -2786,35 +3119,116 @@@ monoview_image case SEQ_TYPE_MOVIE: { - seq_open_anim_file(seq, false); + StripAnim *sanim; + bool is_multiview = (context->scene->r.scemode & R_MULTIVIEW) != 0; + + /* load all the videos */ + seq_open_anim_file(context->scene, seq, false); + + if (is_multiview) { + ImBuf **ibuf_arr; + size_t totviews; + size_t totfiles = seq_num_files(context->scene, seq->views_format); + int i; + + if (totfiles != BLI_listbase_count_ex(&seq->anims, totfiles + 1)) + goto monoview_movie; + + totviews = BKE_scene_num_views_get(&context->scene->r); + ibuf_arr = MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbufs"); + + for (i = 0, sanim = seq->anims.first; sanim; sanim = sanim->next, i++) { + if (sanim->anim) { + IMB_Proxy_Size proxy_size = seq_rendersize_to_proxysize(context->preview_render_size); + IMB_anim_set_preseek(sanim->anim, seq->anim_preseek); + + ibuf_arr[i] = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs, + seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, + proxy_size); + - /* fetching for requested proxy sze failed, try fetching the original isntead */ ++ /* fetching for requested proxy size failed, try fetching the original instead */ + if (!ibuf_arr[i] && proxy_size != IMB_PROXY_NONE) { + ibuf_arr[i] = IMB_anim_absolute(sanim->anim, nr + seq->anim_startofs, + seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN, + IMB_PROXY_NONE); + } + if (ibuf_arr[i]) { + /* we don't need both (speed reasons)! */ + if (ibuf_arr[i]->rect_float && ibuf_arr[i]->rect) + imb_freerectImBuf(ibuf_arr[i]); + } + } + } - if (seq->anim) { - IMB_Proxy_Size proxy_size = seq_rendersize_to_proxysize(context->preview_render_size); - IMB_anim_set_preseek(seq->anim, seq->anim_preseek); + if (seq->views_format == R_IMF_VIEWS_STEREO_3D) { + if (ibuf_arr[0]) { + IMB_ImBufFromStereo(seq->stereo3d_format, &ibuf_arr[0], &ibuf_arr[1]); + } + else { + /* probably proxy hasn't been created yet */ + MEM_freeN(ibuf_arr); + break; + } + } - ibuf =
[Bf-blender-cvs] [1f3114e] multiview: Image: refactor image_load_image_file() function as suggested on review
Commit: 1f3114ef635474a715b17c52307bbda9e4dccc6d Author: Dalai Felinto Date: Thu Feb 5 23:19:23 2015 -0200 Branches: multiview https://developer.blender.org/rB1f3114ef635474a715b17c52307bbda9e4dccc6d Image: refactor image_load_image_file() function as suggested on review I still need to do the same treatment for image_load_movie_file() (and potentially for image_load_sequence_file() I have to check if it's also the case) Some of the image loading routines in the sequencer could have this treatment as well. Also I think that the whole: "image is an ID block which might be used by multiple users. it should be self-contained in terms what it is." Is not a problem anymore. But I need to dig further, because I don't remmeber if we are using ImageView elsewhere or not. === M source/blender/blenkernel/intern/image.c === diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 023827b..cb0fe4f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -3279,27 +3279,17 @@ static ImBuf *image_load_movie_file(Image *ima, ImageUser *iuser, int frame) return r_ibuf; } -/* warning, 'iuser' can be NULL */ -static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) +static struct ImBuf *load_image_single(Image *ima, ImageUser *iuser, int cfra, + const size_t view_id, + const bool has_packed, + bool *r_assign) { - struct ImBuf **ibuf_arr; - struct ImBuf *r_ibuf; - char **filepath_arr; - bool assign = false; + char filepath[FILE_MAX]; + struct ImBuf *ibuf = NULL; int flag; - const bool is_multiview = (ima->flag & IMA_IS_MULTIVIEW) != 0; - const size_t totfiles = image_num_files(ima); - const size_t totviews = is_multiview ? BLI_listbase_count(&ima->views) : 1; - const bool has_packed = BKE_image_has_packedfile(ima); - size_t i; - - /* always ensure clean ima */ - BKE_image_free_buffers(ima); + ImageView *iv; - ibuf_arr = MEM_mallocN(sizeof(ImBuf *) * totviews, "Image Views Imbufs"); - filepath_arr = MEM_mallocN(sizeof(char *) * totviews, "Image filepaths"); - for (i = 0; i < totfiles; i++) - filepath_arr[i] = MEM_mallocN(sizeof(char) * FILE_MAX, "Image filepath"); + iv = BLI_findlink(&ima->views, view_id); /* is there a PackedFile with this image ? */ if (has_packed) { @@ -3308,113 +3298,138 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra) flag = IB_rect | IB_multilayer; flag |= imbuf_alpha_flags_for_image(ima); - /* XXX what to do */ - BLI_assert(totfiles == BLI_listbase_count_ex(&ima->packedfiles, totfiles + 1)); - - for (i = 0, imapf = ima->packedfiles.first; imapf; imapf = imapf->next, i++) { - ibuf_arr[i] = IMB_ibImageFromMemory( - (unsigned char *)imapf->packedfile->data, imapf->packedfile->size, flag, - ima->colorspace_settings.name, ""); - } + imapf = BLI_findlink(&ima->packedfiles, view_id); + ibuf = IMB_ibImageFromMemory( + (unsigned char *)imapf->packedfile->data, imapf->packedfile->size, flag, + ima->colorspace_settings.name, ""); } else { + ImageUser iuser_t; + flag = IB_rect | IB_multilayer | IB_metadata; flag |= imbuf_alpha_flags_for_image(ima); /* get the correct filepath */ BKE_image_user_frame_calc(iuser, cfra, 0); - for (i = 0; i < totfiles; i++) { - ImageUser iuser_t; - - if (iuser) - iuser_t = *iuser; - else - iuser_t.framenr = ima->lastframe; + if (iuser) + iuser_t = *iuser; + else + iuser_t.framenr = ima->lastframe; - iuser_t.view = i; + iuser_t.view = view_id; - BKE_image_user_file_path(&iuser_t, ima, filepath_arr[i]); + BKE_image_user_file_path(&iuser_t, ima, filepath); - /* read ibuf */ - ibuf_arr[i] = IMB_loadiffname(filepath_arr[i], flag, ima->colorspace_settings.name); -
[Bf-blender-cvs] [6478240] multiview: ouch, typo on bitflag operation on image update views format
Commit: 64782406484d18845d8f20a8eac09a2a50caba3e Author: Dalai Felinto Date: Thu Feb 5 21:56:12 2015 -0200 Branches: multiview https://developer.blender.org/rB64782406484d18845d8f20a8eac09a2a50caba3e ouch, typo on bitflag operation on image update views format This should be causing issues, but I have not noticed any. Better fixed than not anyways. === M source/blender/blenkernel/intern/image.c === diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index b10e8af..023827b 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -4484,8 +4484,8 @@ static void image_update_views_format(Scene *scene, Image *ima) } else { monoview: - ima->flag &= IMA_IS_STEREO; - ima->flag &= IMA_IS_MULTIVIEW; + ima->flag &= ~IMA_IS_STEREO; + ima->flag &= ~IMA_IS_MULTIVIEW; BKE_image_free_views(ima); } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [56cf38b] multiview: Code cleanup: create image_add_view function
Commit: 56cf38b00a36e8f02e6bf239d931d22d4ea331d7 Author: Dalai Felinto Date: Thu Feb 5 21:50:30 2015 -0200 Branches: multiview https://developer.blender.org/rB56cf38b00a36e8f02e6bf239d931d22d4ea331d7 Code cleanup: create image_add_view function === M source/blender/blenkernel/intern/image.c === diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 230a1c2..b10e8af 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -103,6 +103,7 @@ static SpinLock image_spin; static size_t image_num_files(struct Image *ima); static ImBuf *image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r); static void image_update_views_format(Scene *scene, Image *ima); +static void image_add_view(Image *ima, const char *viewname, const char *filepath); /* max int, to indicate we don't store sequences in ibuf */ #define IMA_NO_INDEX0x7FEFEFEF @@ -862,7 +863,6 @@ Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int hei for (view_id = 0; view_id < 2; view_id++) { ImBuf *ibuf; - ImageView *iv; ibuf = add_ibuf_size(width, height, ima->name, depth, floatbuf, gen_type, color, &ima->colorspace_settings); image_assign_ibuf(ima, ibuf, stereo3d ? view_id : IMA_NO_INDEX, 0); @@ -870,9 +870,7 @@ Image *BKE_image_add_generated(Main *bmain, unsigned int width, unsigned int hei IMB_freeImBuf(ibuf); if (!stereo3d) break; - iv = MEM_mallocN(sizeof(ImageView), "Viewer Image View"); - BLI_strncpy(iv->name, names[view_id], sizeof(iv->name)); - BLI_addtail(&ima->views, iv); + image_add_view(ima, names[view_id], ""); } ima->ok = IMA_OK_LOADED; @@ -2354,13 +2352,10 @@ Image *BKE_image_verify_viewer(int type, const char *name) static void image_viewer_create_views(const RenderData *rd, Image *ima) { SceneRenderView *srv; - ImageView *iv; for (srv = rd->views.first; srv; srv = srv->next) { if (BKE_scene_render_view_active(rd, srv) == false) continue; - iv = MEM_mallocN(sizeof(ImageView), "Viewer Image View"); - BLI_strncpy(iv->name, srv->name, sizeof(iv->name)); - BLI_addtail(&ima->views, iv); + image_add_view(ima, srv->name, ""); } } @@ -2852,23 +2847,22 @@ bool BKE_image_save_openexr_multiview(Image *ima, ImBuf *ibuf, const char *filep / multiview load openexr */ -#ifdef WITH_OPENEXR -static void image_add_view_cb(void *base, const char *str) +static void image_add_view(Image *ima, const char *viewname, const char *filepath) { - Image *ima = base; ImageView *iv; iv = MEM_mallocN(sizeof(ImageView), "Viewer Image View"); - BLI_strncpy(iv->name, str, sizeof(iv->name)); + BLI_strncpy(iv->name, viewname, sizeof(iv->name)); + BLI_strncpy(iv->filepath, filepath, sizeof(iv->filepath)); /* For stereo drawing we need to ensure: * STEREO_LEFT_NAME == STEREO_LEFT_ID and * STEREO_RIGHT_NAME == STEREO_RIGHT_ID */ - if (STREQ(str, STEREO_LEFT_NAME)) { + if (STREQ(viewname, STEREO_LEFT_NAME)) { BLI_addhead(&ima->views, iv); } - else if (STREQ(str, STEREO_RIGHT_NAME)) { + else if (STREQ(viewname, STEREO_RIGHT_NAME)) { ImageView *left_iv = BLI_findstring(&ima->views, STEREO_LEFT_NAME, offsetof(ImageView, name)); if (left_iv == NULL) { @@ -2883,6 +2877,13 @@ static void image_add_view_cb(void *base, const char *str) } } +#ifdef WITH_OPENEXR +static void image_add_view_cb(void *base, const char *str) +{ + Image *ima = base; + image_add_view(ima, str, ima->name); +} + static void image_add_buffer_cb(void *base, const char *str, ImBuf *ibuf, const int frame) { Image *ima = base; @@ -4429,10 +4430,7 @@ static void image_update_views_format(Scene *scene, Image *ima) ima->flag |= IMA_IS_STEREO; for (i = 0; i < 2; i++) { - iv = MEM_mallocN(sizeof(ImageView), "Image View Stereo (open)"); - BLI_strncpy(iv->name, names[i], sizeof(iv->name)); - BLI_strncpy(iv->filepath, ima->name, sizeof(iv->filepath)); - BLI_addtail(&ima->views, iv