3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 8 Aug 2018 03:14:07 +0000 (13:14 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: correct header guard
Campbell Barton [Wed, 8 Aug 2018 03:10:53 +0000 (13:10 +1000)]
Cleanup: correct header guard

Header guard was duplicated before renaming.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 8 Aug 2018 01:53:22 +0000 (11:53 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: use conforming header guard
Campbell Barton [Wed, 8 Aug 2018 01:49:51 +0000 (11:49 +1000)]
Cleanup: use conforming header guard

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 8 Aug 2018 01:33:42 +0000 (11:33 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: indentation
Campbell Barton [Wed, 8 Aug 2018 01:31:28 +0000 (11:31 +1000)]
Cleanup: indentation

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Wed, 8 Aug 2018 01:05:08 +0000 (11:05 +1000)]
Merge branch 'master' into blender2.8

3 years agoCleanup: use static variables
Campbell Barton [Wed, 8 Aug 2018 01:00:57 +0000 (11:00 +1000)]
Cleanup: use static variables

3 years agoCleanup: style
Campbell Barton [Wed, 8 Aug 2018 00:59:50 +0000 (10:59 +1000)]
Cleanup: style

3 years agoCleanup: Fix stupid duplication
Antonioya [Tue, 7 Aug 2018 20:26:54 +0000 (22:26 +0200)]
Cleanup: Fix stupid duplication

3 years agoFix memory leak in previous commit
Antonioya [Tue, 7 Aug 2018 20:22:03 +0000 (22:22 +0200)]
Fix memory leak in previous commit

3 years agoFix T56266: Second try to fix material problems
Antonioya [Tue, 7 Aug 2018 20:13:02 +0000 (22:13 +0200)]
Fix T56266: Second try to fix material problems

3 years agomacOS GHOST: use non-deprecated functions for coordinates
Arto Kitula [Tue, 7 Aug 2018 18:53:02 +0000 (21:53 +0300)]
macOS GHOST: use non-deprecated functions for coordinates

3 years agoFix T56266: Grease Pencil Tint and Color modifier error when apply
Antonioya [Tue, 7 Aug 2018 18:10:20 +0000 (20:10 +0200)]
Fix T56266: Grease Pencil Tint and Color modifier error when apply

The material created was not right when apply the modifiers.

These errors were related to the material modification from old palette system before the merge and for any reason this code was not changed in the right way.

Also changed the "Create Colors" to "Create Materials" to keep UI names aligned.

3 years agoCleanup: Tag only objects of the scene collections
Antonioya [Tue, 7 Aug 2018 14:41:38 +0000 (16:41 +0200)]
Cleanup: Tag only objects of the scene collections

In previous commit the bmain loop updated all GP objects, but must tag only scene collection objects.

3 years agoFix T54799: NDOF events not dispatched on windows.
mano-wii [Tue, 7 Aug 2018 14:41:55 +0000 (11:41 -0300)]
Fix T54799: NDOF events not dispatched on windows.

Caused by commit rB785e8a636a29

3 years agoFix T56263: Crash when sculpting a GP object with animation
Antonioya [Tue, 7 Aug 2018 12:15:41 +0000 (14:15 +0200)]
Fix T56263: Crash when sculpting a GP object with animation

This is a limitation of the current operator design.

I have added a test to be sure the operator is not initializated while play animations to avoid segment fault.

In the future, we can enable this option again, but it will need a operator redesign.

3 years agoCleanup GP: Change playing field to boolean
Antonioya [Tue, 7 Aug 2018 11:56:30 +0000 (13:56 +0200)]
Cleanup GP: Change playing field to boolean

3 years agoFix T56261: Grease Pencil simplify options get segment fault
Antonioya [Tue, 7 Aug 2018 11:36:30 +0000 (13:36 +0200)]
Fix T56261: Grease Pencil simplify options get segment fault

The depsgraph was not updated as expected with the function used and the cache was not set as dirty.

3 years agoFix T56252: Selectable Bases includes hidden objects
Campbell Barton [Tue, 7 Aug 2018 03:22:07 +0000 (13:22 +1000)]
Fix T56252: Selectable Bases includes hidden objects

3 years agoFix T56258: Solidify assert w/ empty mesh
Campbell Barton [Tue, 7 Aug 2018 02:58:08 +0000 (12:58 +1000)]
Fix T56258: Solidify assert w/ empty mesh

3 years agoFix T56255: Crash w/ collection access from Python
Campbell Barton [Tue, 7 Aug 2018 02:45:01 +0000 (12:45 +1000)]
Fix T56255: Crash w/ collection access from Python

3 years agomacOS Deps: use xcode 10.13 sdk
Arto Kitula [Mon, 6 Aug 2018 19:55:25 +0000 (22:55 +0300)]
macOS Deps: use xcode 10.13 sdk

3 years agoGP: Add Simplify Shader FX option
Antonioya [Mon, 6 Aug 2018 15:01:47 +0000 (17:01 +0200)]
GP: Add Simplify Shader FX option

This option was missing when old VFX modifers were backported as Shader FX.

3 years agoGP: Fix Front z-depth display precision
Antonioya [Mon, 6 Aug 2018 14:11:31 +0000 (16:11 +0200)]
GP: Fix  Front z-depth display precision

The zdepth 0 was clipped and need 0.000001

3 years agoPyAPI: Make skin modifier roots settable
Andrew Hale [Mon, 6 Aug 2018 09:37:49 +0000 (11:37 +0200)]
PyAPI: Make skin modifier roots settable

This make the root flag writable using the Python API, using the
generic skin vertex flag setter function.

Reviewed By: Campbell Barton

Differential Revision:

3 years agoFix horrible invalid mesh freeing in weightvg modifiers.
Bastien Montagne [Mon, 6 Aug 2018 09:48:05 +0000 (11:48 +0200)]
Fix horrible invalid mesh freeing in weightvg modifiers.

Comes from rB7661f8a65b. Found while checking on T55818, but not solving
that issue of course.

3 years agoCleanup LIB_ID_COPY_ flags a bit, add missing comment.
Bastien Montagne [Mon, 6 Aug 2018 09:45:56 +0000 (11:45 +0200)]
Cleanup LIB_ID_COPY_ flags a bit, add missing comment.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 6 Aug 2018 07:13:27 +0000 (17:13 +1000)]
Merge branch 'master' into blender2.8

3 years agoFix T55012: Corruption editing screen keymap
Campbell Barton [Mon, 6 Aug 2018 07:08:39 +0000 (17:08 +1000)]
Fix T55012: Corruption editing screen keymap

3 years agoCleanup: unused vars
Campbell Barton [Mon, 6 Aug 2018 02:52:48 +0000 (12:52 +1000)]
Cleanup: unused vars

3 years agoCleanup: line length
Campbell Barton [Mon, 6 Aug 2018 02:49:02 +0000 (12:49 +1000)]
Cleanup: line length

3 years agoFix T54915: Usercount of active action increases when editing things with COW enabled.
Bastien Montagne [Sun, 5 Aug 2018 16:50:01 +0000 (18:50 +0200)]
Fix T54915: Usercount of active action increases when editing things with COW enabled.

Just pass along the 'no user refcount' flag to animdata copy function.

3 years agoGP: Add python api to create brush settings for grease pencil
Antonioya [Sun, 5 Aug 2018 14:19:24 +0000 (16:19 +0200)]
GP: Add python api to create brush settings for grease pencil

3 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Sun, 5 Aug 2018 10:15:13 +0000 (12:15 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix Cycles crash rendering mix of instanced and non-instanced volumes.
Brecht Van Lommel [Sun, 5 Aug 2018 09:58:31 +0000 (11:58 +0200)]
Fix Cycles crash rendering mix of instanced and non-instanced volumes.

3 years agoGP: Fix NULL pointer when preview is not ready
Antonioya [Sun, 5 Aug 2018 09:06:20 +0000 (11:06 +0200)]
GP: Fix NULL pointer when preview is not ready

The preview cannot be ready when create a material with python

3 years agoMinor fix unused var compiler warning.
Bastien Montagne [Sun, 5 Aug 2018 07:19:15 +0000 (09:19 +0200)]
Minor fix unused var compiler warning.

3 years agoGP: Fix stupid mistake in mirror modifier
Antonioya [Sat, 4 Aug 2018 13:59:57 +0000 (15:59 +0200)]
GP: Fix stupid mistake in mirror modifier

The object can be NULL. This was a line used in debug that it was not removed.

Also removed an old function not used.

Thanks to Charlie Jolly for catching this error.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Sat, 4 Aug 2018 11:43:10 +0000 (13:43 +0200)]
Merge branch 'master' into blender2.8

3 years agoFix T56222: Bevel Modifier bug (uninitialized value).
Bastien Montagne [Sat, 4 Aug 2018 11:40:38 +0000 (13:40 +0200)]
Fix T56222: Bevel Modifier bug (uninitialized value).

3 years agoFix GP mirror modifier axis
Charlie Jolly [Sat, 4 Aug 2018 07:49:15 +0000 (09:49 +0200)]
Fix GP mirror modifier axis

3 years agoGrease Pencil: Set Lock Axis default to Y axis
Antonioya [Fri, 3 Aug 2018 19:06:49 +0000 (21:06 +0200)]
Grease Pencil: Set Lock Axis default to Y axis

3 years agoCleanup: Fix comment
Antonioya [Fri, 3 Aug 2018 15:41:20 +0000 (17:41 +0200)]
Cleanup: Fix comment

3 years agoNew grease pencil primitive STROKE
Antonioya [Fri, 3 Aug 2018 15:37:21 +0000 (17:37 +0200)]
New grease pencil primitive STROKE

This creates a simple stroke with several colors to have a basic structure to start drawing.

3 years agoReplace wrong aasign material flag to BKE_MAT_ASSIGN_USERPREF
Antonioya [Fri, 3 Aug 2018 14:36:53 +0000 (16:36 +0200)]
Replace wrong aasign material flag to BKE_MAT_ASSIGN_USERPREF

3 years agoGPUShader: Fix warning in release build.
Clément Foucault [Fri, 3 Aug 2018 12:34:05 +0000 (14:34 +0200)]
GPUShader: Fix warning in release build.

3 years agoAdd missing single user management for grease pencil materials
Antonioya [Fri, 3 Aug 2018 11:41:40 +0000 (13:41 +0200)]
Add missing single user management for grease pencil materials

3 years agoBugfix: audaspace cmake variables need to be cached.
Joerg Mueller [Fri, 3 Aug 2018 08:58:42 +0000 (10:58 +0200)]
Bugfix: audaspace cmake variables need to be cached.

3 years agoFix T56217: Segment Fault when using the Fill Brush on Blank GP Object
Antonioya [Fri, 3 Aug 2018 08:28:27 +0000 (10:28 +0200)]
Fix T56217: Segment Fault when using the Fill Brush on Blank GP Object

The error was in any GP object without layers.

Also added a check to avoid paint in a locked layer.

3 years agoFix T56180: Grease Pencil edit mode select menu crash.
Bastien Montagne [Fri, 3 Aug 2018 08:25:06 +0000 (10:25 +0200)]
Fix T56180: Grease Pencil edit mode select menu crash.

Note that there are most certainly many other operators that’d need that
same flag... Don’t have time to hunt them down currently, will just fix
as issues are found, for now.

3 years agoFix T55791: blender 2.8 crash on redoing 'snap to cursor' with Offset option ON.
Bastien Montagne [Fri, 3 Aug 2018 08:17:00 +0000 (10:17 +0200)]
Fix T55791: blender 2.8 crash on redoing 'snap to cursor' with Offset option ON.

Many snap_to operators need a fully evaluated depsgraph to run

3 years agoOperators: add a new flag stating that operator needs access to evaluated data.
Bastien Montagne [Fri, 3 Aug 2018 08:15:34 +0000 (10:15 +0200)]
Operators: add a new flag stating that operator needs access to evaluated data.

For now, that flag is only used in redo code, since after undo step
depsgraph is totally empty... We *may* want to add at least an assert in
op calling code too, though?

3 years agoDepsgraph: add helper to ensure a given scene/view_layer graph is up-to-date.
Bastien Montagne [Fri, 3 Aug 2018 08:13:33 +0000 (10:13 +0200)]
Depsgraph: add helper to ensure a given scene/view_layer graph is up-to-date.

Since that call make the graph active, it should only be used in active
editing context aware code (i.e. essentially, operators).

3 years agoDRW: Augment Debug messages
Clément Foucault [Fri, 3 Aug 2018 07:49:22 +0000 (09:49 +0200)]
DRW: Augment Debug messages

3 years agoEevee: Fix assert with hair drawing
Clément Foucault [Fri, 3 Aug 2018 07:48:28 +0000 (09:48 +0200)]
Eevee: Fix assert with hair drawing

This remove unused clip_block when not needed and the useless ubo bind that
were put there for the sake of not crashing.

3 years agoIcons: add particle brush icons
Campbell Barton [Fri, 3 Aug 2018 01:43:50 +0000 (11:43 +1000)]
Icons: add particle brush icons

3 years agoEevee: Don't show probe display when not using scene lighting
Clément Foucault [Thu, 2 Aug 2018 19:12:08 +0000 (21:12 +0200)]
Eevee: Don't show probe display when not using scene lighting

The display is broken otherwise.

3 years agoEevee: Fix missing UBO bind.
Clément Foucault [Thu, 2 Aug 2018 17:32:31 +0000 (19:32 +0200)]
Eevee: Fix missing UBO bind.

3 years agoAdd Assign Material option to Special menu (W key)
Antonioya [Thu, 2 Aug 2018 17:35:29 +0000 (19:35 +0200)]
Add Assign Material option to Special menu (W key)

Also some renames and cleanups.

3 years agoAdd list of color to Assign color operator
Antonioya [Thu, 2 Aug 2018 17:21:12 +0000 (19:21 +0200)]
Add list of color to Assign color operator

It's more clear for user to see the name of the color

3 years agoDRW: Add UBO binding checking routine.
Clément Foucault [Thu, 2 Aug 2018 16:33:19 +0000 (18:33 +0200)]
DRW: Add UBO binding checking routine.

3 years agoCleanup: Fix compilation warnings.
Clément Foucault [Thu, 2 Aug 2018 16:32:50 +0000 (18:32 +0200)]
Cleanup: Fix compilation warnings.

3 years agoDRW: Cleanup: Fix header naming.
Clément Foucault [Thu, 2 Aug 2018 16:32:10 +0000 (18:32 +0200)]
DRW: Cleanup: Fix header naming.

3 years agoGPUShader: Add name for debugging & identifying shaders.
Clément Foucault [Thu, 2 Aug 2018 16:31:38 +0000 (18:31 +0200)]
GPUShader: Add name for debugging & identifying shaders.

3 years agoEevee: Fix missing UBO binds.
Clément Foucault [Thu, 2 Aug 2018 16:03:47 +0000 (18:03 +0200)]
Eevee: Fix missing UBO binds.

Some of them are unecessary and should be removed from the shader instead.

But for now we need a quick fix for the crashes happening on some platforms.

See T55475.

3 years agoFix missing type for material arry
Antonioya [Thu, 2 Aug 2018 16:03:01 +0000 (18:03 +0200)]
Fix missing type for material arry

This function was called by RNA Api and had grease pencil object type missing.

3 years agoFix wrong RNA Api parameter definition
Antonioya [Thu, 2 Aug 2018 15:45:17 +0000 (17:45 +0200)]
Fix wrong RNA Api parameter definition

3 years agoDepsgraph: fix some DEG queries crashing with new, empty graph.
Bastien Montagne [Thu, 2 Aug 2018 15:15:56 +0000 (17:15 +0200)]
Depsgraph: fix some DEG queries crashing with new, empty graph.

Calling code is responsible to check on NULL pointers here, or ensure
is does have a fully built and evaluated depsgraph, but this should
never crash in DEG queries themselves.

3 years agoFix assert in UI string trimming code when we have 'protected' right part.
Bastien Montagne [Thu, 2 Aug 2018 14:38:39 +0000 (16:38 +0200)]
Fix assert in UI string trimming code when we have 'protected' right part.

3 years agoUI: Move thickness before frame lock in Annotation Panel
Antonioya [Thu, 2 Aug 2018 14:22:53 +0000 (16:22 +0200)]
UI: Move thickness before frame lock in Annotation Panel

The thickness is more important and must be below list of annotation layers.

3 years agoCleanup: use dictionary for icon lookup
Campbell Barton [Thu, 2 Aug 2018 12:28:48 +0000 (22:28 +1000)]
Cleanup: use dictionary for icon lookup

3 years agoUI: show all particle brush settings in topbar
Campbell Barton [Thu, 2 Aug 2018 12:10:38 +0000 (22:10 +1000)]
UI: show all particle brush settings in topbar

Also show particle brush in tool-properties panel.

3 years agoUI: show particle radius & strength in topbar
Campbell Barton [Thu, 2 Aug 2018 11:27:12 +0000 (21:27 +1000)]
UI: show particle radius & strength in topbar

3 years agoSubsurf: Better crease which represents sharp edges
Sergey Sharybin [Thu, 2 Aug 2018 10:22:55 +0000 (12:22 +0200)]
Subsurf: Better crease which represents sharp edges

Enabled infinite sharp patches for topology refiner and evaluator,
which allows to have sharp edge at first subdivision level.

Also tweaked crease export from Blender to OpenSubdiv to have more
artistic control over the whole 0..1 range.

3 years agoTool System: initial particle system support
Campbell Barton [Thu, 2 Aug 2018 07:41:11 +0000 (17:41 +1000)]
Tool System: initial particle system support

3 years agoTool System: sync changes from changes to brushes
Campbell Barton [Thu, 2 Aug 2018 06:24:22 +0000 (16:24 +1000)]
Tool System: sync changes from changes to brushes

Changing a brush now updates the tool.

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Thu, 2 Aug 2018 07:52:22 +0000 (17:52 +1000)]
Merge branch 'master' into blender2.8

3 years agoRNA: make particle enum public
Campbell Barton [Thu, 2 Aug 2018 07:49:03 +0000 (17:49 +1000)]
RNA: make particle enum public

3 years agoFix T56199: Crash on Annotation in (VSE) Image Preview
Joshua Leung [Thu, 2 Aug 2018 04:34:27 +0000 (16:34 +1200)]
Fix T56199: Crash on Annotation in (VSE) Image Preview

In some cases (e.g. using old userpref settings/keymaps)
it was possible to trigger a crash when the wrong GP/Annotation
operators were triggered in the wrong contexts (e.g. using
the old GPENCIL_OT_paint in annotation-only contexts like
all the 2D editors).

This commit resolves several issues that were caused by sloppy
code-churn + features that had been hacked on.

3 years agoDev Tooling: Instrument motion path calculation operator (for bones) to collect timin...
Joshua Leung [Thu, 2 Aug 2018 02:46:15 +0000 (14:46 +1200)]
Dev Tooling: Instrument motion path calculation operator (for bones) to collect timing data

This will be useful for checking on the progress of our optimisation
efforts, and to generate some nice stats for later.

3 years agoArmature Panel Tweaks - Motion Paths/Ghosting
Joshua Leung [Thu, 2 Aug 2018 02:44:17 +0000 (14:44 +1200)]
Armature Panel Tweaks - Motion Paths/Ghosting

Since most animators find Motion Paths more useful than Armature Ghosting:
* Move Motion Paths before Ghosting settings (less scrolling)
* Collapse Ghosting panel by default
* Open Motion Paths panel by default instead

3 years agoUI: Slightly larger action zone for corner resizing
Pablo Vazquez [Wed, 1 Aug 2018 23:26:58 +0000 (01:26 +0200)]
UI: Slightly larger action zone for corner resizing

Pretty minor, from 0.6 to 0.8, but the improvement is noticeable
especially when using a stylus, without overlapping too much with
the buttons and dropdowns in headers.

3 years agoUI: Group similar Grease Pencil brush settings
Pablo Vazquez [Wed, 1 Aug 2018 22:52:45 +0000 (00:52 +0200)]
UI: Group similar Grease Pencil brush settings

3 years agoUI: Remove OpenGL Render operators from Render menu
Pablo Vazquez [Wed, 1 Aug 2018 22:52:08 +0000 (00:52 +0200)]
UI: Remove OpenGL Render operators from Render menu

Rendering OpenGL/Preview is accessible from each editor.
Render settings are accessible from the Film menu when in OpenGL/Preview engine.
It wasn't always predictable especially with Workspaces without or with many viewports.

Also reordering of items, renaming and removal of superfluous icons.

3 years agoCleanup: warnings, trailing space
Campbell Barton [Wed, 1 Aug 2018 22:26:24 +0000 (08:26 +1000)]
Cleanup: warnings, trailing space

3 years agoGPUMaterial: Normal Map Node: Make default inputs interactives
Clément Foucault [Wed, 1 Aug 2018 20:08:08 +0000 (22:08 +0200)]
GPUMaterial: Normal Map Node: Make default inputs interactives

3 years agoGPUMaterial: Fix assert when shader failed to compile.
Clément Foucault [Wed, 1 Aug 2018 19:45:43 +0000 (21:45 +0200)]
GPUMaterial: Fix assert when shader failed to compile.

3 years agoGPUMaterial: Make Mapping node use UBO storage
Clément Foucault [Wed, 1 Aug 2018 17:37:18 +0000 (19:37 +0200)]
GPUMaterial: Make Mapping node use UBO storage

This means tweaking parameter is now interactive and does not need to
recompile the shaders.

3 years agoGPUMaterial: Make Localize tree live longer
Clément Foucault [Wed, 1 Aug 2018 17:25:58 +0000 (19:25 +0200)]
GPUMaterial: Make Localize tree live longer

This is in order to reference the localized node->storage when populating
the UBO data.

3 years agoGPUMaterial: Fix nearest sampling
Clément Foucault [Wed, 1 Aug 2018 16:07:19 +0000 (18:07 +0200)]
GPUMaterial: Fix nearest sampling

texelFetch return vec4(0.0) if the target pixel is outside the texture
rect. So we mimic the default repeate mode that we have for linear

Fix T56156 Mapping-Node doesn't work

3 years agoGPUUniformBuffer: Fix bad memcpy error catched by asan
Clément Foucault [Wed, 1 Aug 2018 16:02:57 +0000 (18:02 +0200)]
GPUUniformBuffer: Fix bad memcpy error catched by asan

We need to copy the size of the gputype not the padded type.

3 years agoFix T56197: Cycles OpenCL build error after recent changes.
Brecht Van Lommel [Wed, 1 Aug 2018 17:31:27 +0000 (19:31 +0200)]
Fix T56197: Cycles OpenCL build error after recent changes.

3 years agoSubsurf: Evaluate all UV layers
Sergey Sharybin [Wed, 1 Aug 2018 16:31:05 +0000 (18:31 +0200)]
Subsurf: Evaluate all UV layers

Before that it was only first UV layer which was properly evaluated,
the rest were ignored. Now all layers are being properly handled.

3 years agoSubsurf: Add API to provide vertex sharpness
Sergey Sharybin [Wed, 1 Aug 2018 14:04:22 +0000 (16:04 +0200)]
Subsurf: Add API to provide vertex sharpness

Currently unused, added for the future and API completeness.

3 years agoSubsurf: Support subdivision of mesh with just loose elements
Sergey Sharybin [Wed, 1 Aug 2018 13:43:57 +0000 (15:43 +0200)]
Subsurf: Support subdivision of mesh with just loose elements

3 years agoSubsurf: Cleanup, remove unused mappings and topology queries
Sergey Sharybin [Wed, 1 Aug 2018 13:21:14 +0000 (15:21 +0200)]
Subsurf: Cleanup, remove unused mappings and topology queries

3 years agoSubsurf: Fix/workaround crashes and failures with non-manifold geometry
Sergey Sharybin [Wed, 1 Aug 2018 12:48:32 +0000 (14:48 +0200)]
Subsurf: Fix/workaround crashes and failures with non-manifold geometry

The idea is simple: do not provide full topology to OpenSubdiv, leave
edges creation to OpenSubdiv itself. This solves issues with non-manifold
meshes which were known to fail, including the ones from T52059.

On a positive side we can simplify our side of converter, keeping code

it is still possible that we'll need to ensure all loops has same
winding, but that is less things to worry about.

3 years agoSubsurf: Use edge sharpness directly from converter
Sergey Sharybin [Wed, 1 Aug 2018 13:13:24 +0000 (15:13 +0200)]
Subsurf: Use edge sharpness directly from converter

Seems it's behaving correct now, surely more tests needed, but
this is required for now to move forward.

3 years agoSubsurf: Support subdivision of loose elements
Sergey Sharybin [Tue, 31 Jul 2018 13:09:29 +0000 (15:09 +0200)]
Subsurf: Support subdivision of loose elements

Applies to vertices and edges. Biggest annoyance here is that OpenSubdiv's
topology converter expects that there is no loose geometry, otherwise it
is getting confused.

For now solution is to create some sort of mapping from real Mesh vertex
and edge index to a non-loose-index. Now the annoying part is that this
is an extra step to calculate before we can compare topology, meaning FPS
will not be as great as if we knew for sure that topology didn't change.

Loose edges subdivision is different from what it used to be with old
subdivision code, but probably nice feature now is that endpoints of loose
edges are stay at the coarse vertex locations. This allows to have things
like plane with hair strands, without need to duplicate edge vertices at

All this required some re-work of topology refiner creation, which is now
only passing edges and vertices which are adjacent to face. This is how
topology refiner is supposed to be used, and this is how its validator
also works. Vertices which are adjacent to loose edges are marked as
infinite sharp. This seems to be good-enough approximation for now. In the
future we might tweaks things a bit and push such vertices in average
direction of loose edges, to match old subdivision code closer.