Skip to content

Commit b715031

Browse files
committed
Merge branch 'release_0.5.6'
2 parents c0723d2 + 614c9e9 commit b715031

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+732
-537
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
cmake_minimum_required(VERSION 3.2)
2121
project(
2222
splash
23-
VERSION 0.5.4
23+
VERSION 0.5.6
2424
LANGUAGES C CXX
2525
)
2626

NEWS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Splash release notes
22
===================
33

4+
Splash 0.5.6 (2017-02-10)
5+
-------------------------
6+
New features:
7+
* Refactored ImageBufferSpec to add support for YUV (and other formats). Updated other classes to reflect this change
8+
9+
Improvements:
10+
* Added _tex#_size uniform for Texture_Images
11+
* Blender addon can now export a project (and not the whole configuration)
12+
* Refactored ImageBufferSpec to add support for YUV (and other formats). Updated other classes to reflect this change
13+
14+
Bug fixed:
15+
* Fixed videos looping before the end
16+
* Fixed issues with planar audio having only the first channel decoded
17+
* Fixed audio sync
18+
* Fixed GUI creating a Python interpreter in every Scene: only the master Scene is worthy
19+
* Fixed a segfault when quitting
20+
* Fixed partly deadlocks occuring when modifying heavily the configuration at runtime
21+
422
Splash 0.5.4 (2017-01-30)
523
-------------------------
624
New features:

addons/blender/splash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
bl_info = {
2121
"name": "Splash output",
2222
"author": "Emmanuel Durand",
23-
"version": (0, 5, 4),
23+
"version": (0, 5, 6),
2424
"blender": (2, 72, 0),
2525
"location": "3D View > Toolbox, File > Export",
2626
"description": "Utility tools to connect Blender to the Splash videomapper",

addons/blender/splash/nodes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,13 @@ def draw_buttons(self, context, layout):
489489
row = layout.row()
490490
row.prop(self, "name")
491491
row = layout.row()
492-
operator = row.operator("splash.export_node_tree", text="Export tree")
492+
operator = row.operator("splash.export_node_tree", text="Export configuration")
493493
operator.node_name = self.name
494+
operator.export_project = False
495+
row = layout.row()
496+
operator = row.operator("splash.export_node_tree", text="Export project")
497+
operator.node_name = self.name
498+
operator.export_project = True
494499

495500
def init(self, context):
496501
self.inputs.new('NodeSocketInt', 'Refresh rate').default_value = 60

addons/blender/splash/operators.py

Lines changed: 67 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -297,21 +297,27 @@ def execute(self, context):
297297

298298

299299
class SplashExportNodeTree(Operator):
300-
"""Exports the Splash configuration (following the tree starting from this node)"""
300+
"""Exports the Splash configuration or project (following the tree starting from this node)"""
301301
bl_idname = "splash.export_node_tree"
302302
bl_label = "Exports the node tree"
303303

304+
304305
filepath = bpy.props.StringProperty(subtype='FILE_PATH')
305306
filter_glob = bpy.props.StringProperty(
306307
default="*.json",
307308
options={'HIDDEN'},
308309
)
309310

310311
node_name = StringProperty(name='Node name', description='Name of the calling node', default='')
312+
export_project = BoolProperty(name='export_project')
313+
311314
world_node = None
312315
scene_order = []
313316
scene_lists = {}
314317
node_links = {}
318+
project_accepted_types = ['SplashImageNodeType',
319+
'SplashMeshNodeType',
320+
'SplashObjectNodeType']
315321

316322
def execute(self, context):
317323
self.scene_order.clear()
@@ -330,72 +336,91 @@ def execute(self, context):
330336
for scene in connectedScenes:
331337
scene_list = {}
332338
node_links = []
333-
self.parseTree(scene, scene_list, node_links)
339+
self.parseTree(scene, scene_list, node_links, self.export_project)
334340

335341
self.scene_order.append(scene.name)
336342
self.scene_lists[scene.name] = scene_list
337343
self.node_links[scene.name] = node_links
338344

339-
print(self.scene_order)
340-
return self.export()
345+
# Merge scenes info if exporting a project
346+
if self.export_project and len(self.scene_order) > 0:
347+
masterSceneName = self.scene_order[0]
348+
for sceneId in range(1, len(self.scene_order)):
349+
sceneName = self.scene_order[sceneId]
350+
351+
for node in self.scene_lists[sceneName]:
352+
if node not in self.scene_lists[masterSceneName]:
353+
self.scene_lists[masterSceneName][node] = self.scene_lists[sceneName][node]
354+
for link in self.node_links[sceneName]:
355+
self.node_links[masterSceneName].append(link)
356+
357+
self.scene_order = [self.scene_order[0]]
358+
self.scene_lists = {masterSceneName : self.scene_lists[masterSceneName]}
359+
360+
return self.export(self.export_project)
341361

342-
def parseTree(self, node, scene_list, node_links):
343-
scene_list[node.name] = node
362+
def parseTree(self, node, scene_list, node_links, export_project=False):
363+
if not export_project or node.bl_idname in self.project_accepted_types:
364+
scene_list[node.name] = node
344365

345366
connectedNodes = [socket.links[0].from_node for socket in node.inputs if socket.is_linked]
346367
for connectedNode in connectedNodes:
347368
newLink = [connectedNode.name, node.name]
348369
if newLink not in node_links:
349370
node_links.append([connectedNode.name, node.name])
350-
self.parseTree(connectedNode, scene_list, node_links)
371+
self.parseTree(connectedNode, scene_list, node_links, export_project)
351372

352-
def export(self):
373+
def export(self, export_project=False):
353374
file = open(self.filepath, "w", encoding="utf8", newline="\n")
354375
fw = file.write
355376

356-
# World informations
357377
worldArgs = self.world_node.exportProperties(self.filepath)
358378
fw("// Splash configuration file\n"
359379
"// Exported with Blender Splash add-on\n"
360-
"{\n"
361-
" \"encoding\" : \"UTF-8\",\n"
362-
" \"description\" : \"splashConfiguration\",\n"
363-
"\n"
364-
" \"world\" : {\n"
365-
" \"framerate\" : %i\n"
366-
" },\n" % (worldArgs['framerate']))
367-
368-
# Scenes list
369-
fw(" \"scenes\" : [\n")
370-
sceneIndex = 0
371-
for scene in self.scene_order:
372-
# Find the Scene nodes
373-
for node in self.scene_lists[scene]:
374-
if self.scene_lists[scene][node].bl_idname == "SplashSceneNodeType":
375-
args = self.scene_lists[scene][node].exportProperties(self.filepath)
376-
fw(" {\n")
377-
valueIndex = 0
378-
for values in args:
379-
fw(" \"%s\" : %s" % (values, args[values]))
380+
"{\n")
380381

381-
if valueIndex < len(args) - 1:
382+
if export_project:
383+
fw(" \"description\" : \"splashProject\",\n")
384+
else:
385+
fw(" \"description\" : \"splashConfiguration\",\n")
386+
# World informations
387+
fw(" \"world\" : {\n"
388+
" \"framerate\" : %i\n"
389+
" },\n" % (worldArgs['framerate']))
390+
391+
# Scenes list
392+
fw(" \"scenes\" : [\n")
393+
sceneIndex = 0
394+
for scene in self.scene_order:
395+
# Find the Scene nodes
396+
for node in self.scene_lists[scene]:
397+
if self.scene_lists[scene][node].bl_idname == "SplashSceneNodeType":
398+
args = self.scene_lists[scene][node].exportProperties(self.filepath)
399+
fw(" {\n")
400+
valueIndex = 0
401+
for values in args:
402+
fw(" \"%s\" : %s" % (values, args[values]))
403+
404+
if valueIndex < len(args) - 1:
405+
fw(",\n")
406+
else:
407+
fw("\n")
408+
valueIndex = valueIndex + 1
409+
fw(" }")
410+
411+
if sceneIndex < len(self.scene_lists) - 1:
382412
fw(",\n")
383413
else:
384414
fw("\n")
385-
valueIndex = valueIndex + 1
386-
fw(" }")
387-
388-
if sceneIndex < len(self.scene_lists) - 1:
389-
fw(",\n")
390-
else:
391-
fw("\n")
392-
sceneIndex = sceneIndex + 1
393-
fw(" ],\n")
415+
sceneIndex = sceneIndex + 1
416+
fw(" ],\n")
394417

395418
# Scenes information
396419
sceneIndex = 0
397420
for scene in self.scene_order:
398-
fw(" \"%s\" : {\n" % scene)
421+
if not export_project:
422+
fw(" \"%s\" : {\n" % scene)
423+
399424
for node in self.scene_lists[scene]:
400425
if self.scene_lists[scene][node].bl_idname != "SplashSceneNodeType":
401426
args = self.scene_lists[scene][node].exportProperties(self.filepath)
@@ -429,7 +454,8 @@ def export(self):
429454
fw(" }\n")
430455
sceneIndex = sceneIndex + 1
431456

432-
fw("}")
457+
if not export_project:
458+
fw("}")
433459

434460
return {'FINISHED'}
435461

external/ffmpeg

Submodule ffmpeg updated from c269c43 to 148c4fb

include/basetypes.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,11 @@ class BaseObject
489489
*/
490490
AttributeFunctor& addAttribute(const std::string& name, std::function<bool(const Values&)> set, std::function<const Values()> get, const std::vector<char>& types = {});
491491

492+
/**
493+
* \brief Register new attributes
494+
*/
495+
void registerAttributes();
496+
492497
/**
493498
* \brief Set and the description for the given attribute, if it exists
494499
* \param name Attribute name
@@ -534,6 +539,7 @@ class BufferObject : public BaseObject
534539
BufferObject(std::weak_ptr<RootObject> root)
535540
: BaseObject(root)
536541
{
542+
registerAttributes();
537543
}
538544

539545
/**
@@ -603,13 +609,23 @@ class BufferObject : public BaseObject
603609

604610
std::shared_ptr<SerializedObject> _serializedObject; //!< Internal buffer object
605611
bool _newSerializedObject{false}; //!< Set to true during serialized object processing
612+
613+
/**
614+
* \brief Register new attributes
615+
*/
616+
void registerAttributes() { BaseObject::registerAttributes(); }
606617
};
607618

619+
class UserInput;
620+
class ControllerObject;
621+
608622
/*************/
609623
//! Base class for root objects: World and Scene
610624
class RootObject : public BaseObject
611625
{
612-
friend BaseObject; //!< Base objects can access protected members, typically _objects
626+
// UserInput and ControllerObject can access protected members, typically _objects
627+
friend UserInput;
628+
friend ControllerObject;
613629

614630
public:
615631
/**
@@ -705,6 +721,7 @@ class RootObject : public BaseObject
705721
// Tasks queue
706722
std::recursive_mutex _taskMutex;
707723
std::list<std::function<void()>> _taskQueue;
724+
std::mutex _recurringTaskMutex;
708725
std::map<std::string, std::function<void()>> _recurringTasks;
709726

710727
/**

include/controller.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class ControllerObject : public BaseObject
4646
ControllerObject(std::weak_ptr<RootObject> root)
4747
: BaseObject(root)
4848
{
49+
registerAttributes();
4950
}
5051

5152
/**
@@ -164,6 +165,12 @@ class ControllerObject : public BaseObject
164165
* \param cb Callback
165166
*/
166167
void setUserInputCallback(const UserInput::State& state, std::function<void(const UserInput::State&)> cb) const;
168+
169+
protected:
170+
/**
171+
* \brief Register new functors to modify attributes
172+
*/
173+
void registerAttributes() { BaseObject::registerAttributes(); }
167174
};
168175

169176
} // end of namespace

include/factory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class Factory
112112

113113
std::weak_ptr<RootObject> _root; //!< Root object, used as root for all created objects
114114
bool _isScene{false}; //!< True if the root is a Scene, false if it is a World (or if there is no root)
115+
bool _isMasterScene{false}; //!< True if the root is the master Scene
115116
std::map<std::string, Page> _objectBook; //!< List of all creatable objects
116117

117118
/**

include/filter.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class Filter : public Texture
9090
* \brief Get specs of the texture
9191
* \return Return the texture specs
9292
*/
93-
ImageBufferSpec getSpec() const { return _outTextureSpec; }
93+
ImageBufferSpec getSpec() const { return _outTexture->getSpec(); }
9494

9595
/**
9696
* \brief Try to link the given BaseObject to this object
@@ -131,9 +131,10 @@ class Filter : public Texture
131131
ImageBufferSpec _outTextureSpec;
132132

133133
// Filter parameters
134-
std::map<std::string, Values> _filterUniforms; //!< Contains all filter uniforms
135-
bool _render16bits{false}; //!< Set to true for the filter to be rendered in 16bits
136-
bool _updateColorDepth{false}; //!< Set to true if the _render16bits has been updated
134+
std::unordered_map<std::string, Values> _filterUniforms; //!< Contains all filter uniforms
135+
std::string _pixelFormat{"RGBA"}; //!< Output pixel format
136+
bool _render16bits{false}; //!< Set to true for the filter to be rendered in 16bits
137+
bool _updateColorDepth{false}; //!< Set to true if the _render16bits has been updated
137138

138139
std::string _shaderSource{""}; //!< User defined fragment shader filter
139140
std::string _shaderSourceFile{""}; //!< User defined fragment shader filter source file

0 commit comments

Comments
 (0)