From b85e93b24ef6fc9e6d951e6ea72afaa8ce8d838b Mon Sep 17 00:00:00 2001 From: Jim Eckerlein Date: Tue, 5 Nov 2019 14:02:13 +0100 Subject: [PATCH 1/4] Fix bug in Draco encoding for glTF, files are now smaller Data was not quantified properly. It also lets the library choose the suitable encoding method rather than forcing it to use the edgebreaker method. Differential Revision: https://developer.blender.org/D6183 --- extern/draco/src/draco-compressor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extern/draco/src/draco-compressor.cpp b/extern/draco/src/draco-compressor.cpp index 9e63b8d35cb..3262a2c4d4d 100644 --- a/extern/draco/src/draco-compressor.cpp +++ b/extern/draco/src/draco-compressor.cpp @@ -38,6 +38,7 @@ #include "draco/point_cloud/point_cloud.h" #include "draco/core/vector_d.h" #include "draco/io/mesh_io.h" +#include "draco/compression/encode.h" #if defined(_MSC_VER) #define DLL_EXPORT(retType) extern "C" __declspec(dllexport) retType __cdecl @@ -158,16 +159,14 @@ DLL_EXPORT(bool) compress( printf("%s: Normal quantization bits: %d\n", logTag, compressor->quantizationBitsNormal); printf("%s: Position quantization bits: %d\n", logTag, compressor->quantizationBitsTexCoord); - draco::ExpertEncoder encoder(compressor->mesh); + draco::Encoder encoder; encoder.SetSpeedOptions(10 - compressor->compressionLevel, 10 - compressor->compressionLevel); encoder.SetAttributeQuantization(draco::GeometryAttribute::POSITION, compressor->quantizationBitsPosition); encoder.SetAttributeQuantization(draco::GeometryAttribute::NORMAL, compressor->quantizationBitsNormal); encoder.SetAttributeQuantization(draco::GeometryAttribute::TEX_COORD, compressor->quantizationBitsTexCoord); - encoder.SetEncodingMethod(draco::MESH_EDGEBREAKER_ENCODING); - - draco::Status result = encoder.EncodeToBuffer(&compressor->encoderBuffer); + draco::Status result = encoder.EncodeMeshToBuffer(compressor->mesh, &compressor->encoderBuffer); if(!result.ok()) { printf("%s: Could not compress mesh: %s\n", logTag, result.error_msg()); From 909de57afb71d60628b1c41f4071ede763a89298 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 5 Nov 2019 13:25:34 +0100 Subject: [PATCH 2/4] Fix compositor Denoise node showing Normal value buttons Any values typed in here manually would not be used, it needs an image. --- .../nodes/composite/nodes/node_composite_denoise.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/blender/nodes/composite/nodes/node_composite_denoise.c b/source/blender/nodes/composite/nodes/node_composite_denoise.c index bb62869f470..ac30ed9576d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_denoise.c +++ b/source/blender/nodes/composite/nodes/node_composite_denoise.c @@ -33,8 +33,18 @@ static bNodeSocketTemplate cmp_node_denoise_in[] = { {SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f}, - {SOCK_VECTOR, 0, N_("Normal"), 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f}, - {SOCK_RGBA, 1, N_("Albedo"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f}, + {SOCK_VECTOR, + 1, + N_("Normal"), + 0.0f, + 0.0f, + 0.0f, + 0.0f, + -1.0f, + 1.0f, + PROP_NONE, + SOCK_HIDE_VALUE}, + {SOCK_RGBA, 1, N_("Albedo"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, {-1, 0, ""}}; static bNodeSocketTemplate cmp_node_denoise_out[] = {{SOCK_RGBA, 0, N_("Image")}, {-1, 0, ""}}; From 8c2672db0da108b8af849b83fe148976101a1710 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 5 Nov 2019 14:56:31 +0100 Subject: [PATCH 3/4] Fix T71093: fluid settings not visible for workbench engine --- .../startup/bl_ui/properties_physics_fluid.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 8817d35b88a..b9e690629d1 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -65,7 +65,7 @@ class PhysicButtonsPanel: class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): bl_label = "Fluid" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -92,7 +92,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): class PHYSICS_PT_fluid_flow(PhysicButtonsPanel, Panel): bl_label = "Flow" bl_parent_id = "PHYSICS_PT_fluid" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -164,7 +164,7 @@ class PHYSICS_PT_fluid_flow(PhysicButtonsPanel, Panel): class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel): bl_label = "Settings" bl_parent_id = "PHYSICS_PT_fluid" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -253,7 +253,7 @@ class PHYSICS_PT_fluid_settings(PhysicButtonsPanel, Panel): class PHYSICS_PT_fluid_particle_cache(PhysicButtonsPanel, Panel): bl_label = "Cache" bl_parent_id = "PHYSICS_PT_fluid" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -276,7 +276,7 @@ class PHYSICS_PT_domain_bake(PhysicButtonsPanel, Panel): bl_label = "Bake" bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -308,7 +308,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): bl_label = "World" bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -361,7 +361,7 @@ class PHYSICS_PT_domain_viscosity(PhysicButtonsPanel, Panel): bl_label = "Viscosity" bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -391,7 +391,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): bl_label = "Boundary" bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): @@ -425,7 +425,7 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): bl_label = "Particles" bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @classmethod def poll(cls, context): From 1b46b7c42f6a7ce2e0506a1cedf6e2bd084c4894 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 5 Nov 2019 15:33:23 +0100 Subject: [PATCH 4/4] Fix build errors in GHOST SDL --- intern/ghost/intern/GHOST_SystemSDL.cpp | 6 +++--- intern/ghost/intern/GHOST_SystemSDL.h | 2 +- intern/ghost/intern/GHOST_WindowSDL.cpp | 6 +++--- intern/ghost/intern/GHOST_WindowSDL.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp index e3f6f4b6bb1..06a82db1de5 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.cpp +++ b/intern/ghost/intern/GHOST_SystemSDL.cpp @@ -59,7 +59,7 @@ GHOST_IWindow *GHOST_SystemSDL::createWindow(const STR_String &title, GHOST_GLSettings glSettings, const bool exclusive, const bool /* is_dialog */, - const GHOST_TEmbedderWindowID parentWindow) + const GHOST_IWindow *parentWindow) { GHOST_WindowSDL *window = NULL; @@ -70,10 +70,10 @@ GHOST_IWindow *GHOST_SystemSDL::createWindow(const STR_String &title, width, height, state, - parentWindow, type, ((glSettings.flags & GHOST_glStereoVisual) != 0), - exclusive); + exclusive, + parentWindow); if (window) { if (GHOST_kWindowStateFullScreen == state) { diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h index 942b6297c22..c69a7c740bc 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.h +++ b/intern/ghost/intern/GHOST_SystemSDL.h @@ -90,7 +90,7 @@ class GHOST_SystemSDL : public GHOST_System { GHOST_GLSettings glSettings, const bool exclusive = false, const bool is_dialog = false, - const GHOST_TEmbedderWindowID parentWindow = 0); + const GHOST_IWindow *parentWindow = NULL); /* SDL specific */ GHOST_WindowSDL *findGhostWindow(SDL_Window *sdl_win); diff --git a/intern/ghost/intern/GHOST_WindowSDL.cpp b/intern/ghost/intern/GHOST_WindowSDL.cpp index 99988dd55cc..e8d129f45fe 100644 --- a/intern/ghost/intern/GHOST_WindowSDL.cpp +++ b/intern/ghost/intern/GHOST_WindowSDL.cpp @@ -33,10 +33,10 @@ GHOST_WindowSDL::GHOST_WindowSDL(GHOST_SystemSDL *system, GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, - const GHOST_TEmbedderWindowID parentWindow, GHOST_TDrawingContextType type, const bool stereoVisual, - const bool exclusive) + const bool exclusive, + const GHOST_IWindow *parentWindow) : GHOST_Window(width, height, state, stereoVisual, exclusive), m_system(system), m_valid_setup(false), @@ -557,7 +557,7 @@ static SDL_Cursor *sdl_ghost_CreateCursor( } /* TODO, this is currently never freed but it wont leak either. */ -static void getStandardCursorShape(GHOST_TStandardCursor shape) +static SDL_Cursor *getStandardCursorShape(GHOST_TStandardCursor shape) { if (sdl_std_cursor_array[0] == NULL) { #define DEF_CURSOR(name, ind) \ diff --git a/intern/ghost/intern/GHOST_WindowSDL.h b/intern/ghost/intern/GHOST_WindowSDL.h index a5c2fa9b185..d9342de4d69 100644 --- a/intern/ghost/intern/GHOST_WindowSDL.h +++ b/intern/ghost/intern/GHOST_WindowSDL.h @@ -60,10 +60,10 @@ class GHOST_WindowSDL : public GHOST_Window { GHOST_TUns32 width, GHOST_TUns32 height, GHOST_TWindowState state, - const GHOST_TEmbedderWindowID parentWindow, GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone, const bool stereoVisual = false, - const bool exclusive = false); + const bool exclusive = false, + const GHOST_IWindow *parentWindow = NULL); ~GHOST_WindowSDL();