Commit Graph

76 Commits

Author SHA1 Message Date
e8da6131fd License headers: use SPDX-FileCopyrightText for all addons
Move copyright text to SPDX-FileCopyrightText or set to the
Blender Foundation so "make check_licenses" now runs without warnings.
2023-06-15 16:54:05 +10:00
27ee432965 Official add-ons: fix printf-style format translation for i18n
Following up to D15615, I noticed that many messages are either
properly extracted, but not translated due to the use of printf-style
formatting in strings, or not extracted at all. Using the pgettext
function explicitly before formatting fixes that.

Since the affected messages are already extracted, no additional work
is needed from translators.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D16373
2022-11-15 11:13:22 +01:00
a28c3f9cc0 Fix T102396: ValueError: matrix does not have an inverse
Refactor the matrix stack in a way that does not require matrix
inversion. Basically, store the state of the final transform in
the stack.

Technically this makes regression test to fail with Blender Icons,
but the new code gives more correct icons. So the reference image
is to simply be regenerated.
2022-11-10 11:07:05 +01:00
99d2c979a9 Cleanup: fix typos
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D16234
2022-10-14 19:52:42 +02:00
a2e69343eb Fix (partial) T92713: SVG importer: Implicit close keeps current point
Don't change current point coordinate for implicit path close.
This can fix some broken paths in T92713.

Differential Revision: https://developer.blender.org/D16198
2022-10-11 09:49:59 +02:00
eb09be71a9 Fix (partial) T92713: SVG importer: Ensure path closed before MoveTo
This can fix some broken paths in T92713, like the following PeerTube icon.

| before | now
| {F13615071} | {F13615072}

But some icons are still incomplete due to other issues.

Differential Revision: https://developer.blender.org/D16143
2022-10-06 11:26:07 +02:00
016430de4b Cleanup: remove <pep8 compliant> comment
This is no longer necessary, see: T98554.
2022-06-03 11:50:32 +10:00
b8d86ccc0a File headers: use SPDX license identifiers
See T95597
2022-02-11 16:05:07 +11:00
d169df69b3 Fix T81374: SVG import: transform skewX and skewY swapped
When importing an SVG file that uses skewX and skewY, they are swapped.
This patch swaps the skewX and skewY functions and hence the problem is resolved.

Differential Revision: https://developer.blender.org/D13036
2021-11-05 11:38:55 +01:00
c2c5392e00 svg (official) addon: cleanup: Simpified a code path
Simpified a code path

The last return was never reached

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D11964
2021-07-29 14:22:11 +02:00
f21f6d34ba Fix T88651: svg rect not using id as name
The rectangle shape was not using the `id` as the object name when
importing. All other shapes are doing it this way already.

The patch calls `id_names_from_node` to set the name to the `id`.
Credits go to @ariejdl.

Reviewed By: sergey

Maniphest Tasks: T88651

Differential Revision: https://developer.blender.org/D11429
2021-06-01 09:20:25 +02:00
4cb833e84a Fix for T87654: SVG import parse error
Fix for SVG data when there is no space between some arguments in the arc command.
See T87654 for example files.

See https://www.w3.org/TR/SVG2/paths.html#TheDProperty for arguments to the elliptical arc curve commands.

Maniphest Tasks: T87654

Differential Revision: https://developer.blender.org/D11027
2021-04-22 12:48:12 +02:00
6598f0a25c Cleanup: trailing space 2020-01-29 13:51:36 +11:00
48ef856ed3 Fix D4319 (scaling of svg in different page scales)
Looks like my code in https://developer.blender.org/D4319 apply SVG scaling second time.. sorry
This is fix of it

Test files 10cm rect with different page scale:

{F7777057}

{F7777056}

Must be same size

Reviewers: antoniov

Differential Revision: https://developer.blender.org/D5917
2019-09-27 16:48:34 +02:00
7f97ceb050 SVG: Refactor, move utilities to module
Also cover with unit test.
2019-09-19 15:33:28 +02:00
7842e73199 Cleanup: Spelling in comment 2019-09-19 12:08:32 +02:00
8db12f1456 SVG Import: Match SVG-document units with Blender units:
Differential Revision: https://developer.blender.org/D4319
2019-09-11 12:39:37 +02:00
539e24046e SVG Import: Fix offset while import SVG files
The file saved as Inkscape SVG moved to the top, regular SVG stays in place. Blender checks if SVG have an special attribute  `inkscape:version`, and if it has one, it move all SVG to the top. The idea is to match bottom right corner with world origin, instead top right corner:

But why height is not equal the real height of the SVG?  Well, because it's not a height of SVG itself, it is size of SVG on printing or displaying in web-page or in previewer. The real height of SVG in SVG-units is located in viewbox attribute:

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox

So I suggest to move SVG content to real height of SVG located in viewbox attribute:

Reviewers: sergey, antoniov

Reviewed By: antoniov

Subscribers: meta-androcto, antoniov, jms, sergey

Tags: #add-ons

Differential Revision: https://developer.blender.org/D5727
2019-09-11 12:39:37 +02:00
d8177d9e92 Fix T62883: Import SVG file remove fill color.
rBbc5b0f7a091c changed the default fill mode for curves.
Instead of being "fill" it is now "none".
The creates a problem because the svg importer seems to rely on curves being filled by default.

This diff should fix it.

(Note that this is my first patch)

Reviewers: sergey, mont29

Reviewed By: mont29

Subscribers: mont29

Differential Revision: https://developer.blender.org/D4582
2019-03-25 15:48:45 +01:00
b1320f3af6 Fix T61707: Use id attribute to initialize object and curve names
Reviewers: sergey

Differential Revision: https://developer.blender.org/D4377
2019-02-19 15:38:38 +01:00
7e77c6ef60 SVG: Properly handle values in exponential notation
Some SVG exporters outputs small values in an exponential
notation. There is no big reason to reject those files.

This change makes it so any notation of the value is accepted.
Only do it in the path point parsing, since other areas are
already dealing with this correct.

Also covered the array parsing covered with a unit test which
can be run as a stand-alone application.

The parsing code is from Jacques Lucke, thanks!

Differential Revision: https://developer.blender.org/D4234
2019-02-01 15:44:21 +01:00
4e8ddec4e1 Fix: Material.diffuse_color has an alpha component now 2019-01-30 12:44:08 +01:00
747c0a3731 Merge branch 'master' into blender2.8 2018-10-29 16:09:54 +01:00
c2aef4a98f SVG: Fix wrong closed path with quadratic segments
Fixes T55601: SVG import wrong shape
2018-10-29 16:09:02 +01:00
a1aeff9890 SVG: Fix wrong quadratic path when point is duplicate 2018-10-29 15:55:52 +01:00
67b0a56743 SVG: Cleanup, don't use semicolon 2018-10-29 15:50:06 +01:00
f99816d142 SVG: Cleanup, indendation 2018-10-29 15:44:39 +01:00
89716be25e SVG: Cleanup, space around operator 2018-10-29 14:59:58 +01:00
85e6619a02 Merge branch 'master' into blender2.8 2018-10-29 14:50:42 +01:00
08cdf06f89 SVG: Fix for typos
Patch provided by @cyp
2018-10-29 14:49:58 +01:00
13c84813bf Cleanup: remove unneeded keyword argument 2018-10-24 10:43:05 +11:00
dc212f77d1 SVG Format: minor Blender 2.8 fixes 2018-10-22 17:13:13 +02:00
1c75533d9c Merge branch 'master' into blender2.8 2018-10-19 18:13:31 +02:00
d7d3233715 Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3746
2018-10-19 18:12:29 +02:00
251c518ada SVG Import: use '@' for matrix multiply
D3624 by @oirish
2018-08-21 23:09:14 +10:00
2a0d3baf6f SVG: Port to 2.8 2018-07-05 10:09:37 +02:00
b302fdf053 Fix T52822: Incorrect dimensions of imported svg files
Was caused by fix for T45460. Now both reports should be fixed properly.
2017-09-19 12:52:34 +05:00
97bf32a8b8 Fix T51594: SVG Importer: circles and rectangles don't get datablocks named after the original objects 2017-05-24 16:27:10 +02:00
9b58f808c2 Fix T49791: Distorted curves when importing SVG 2016-10-21 16:31:28 +02:00
88daec3206 SVG importer: Fix typo in comment 2016-10-21 15:56:50 +02:00
f5401b5aa1 Fix T49476: SVG importer distorts the color information
This is quite weak solution and not happy with it, but should cover
most of the use-cases.
2016-10-14 16:36:25 +02:00
970011fdcd Fix T47580: Can not import specific SVG 2016-04-19 15:38:42 +02:00
6266b41395 SVGParseFloat() improved parsing of scientific notation
io_curve_svg.import_svg.SVGParseFloat() may parse a float containing scientific
notation without an exponent sign. For example, 1e3 is a legal float value
according to the <number> syntax:

  https://www.w3.org/TR/SVG11/types.html#DataTypeNumber

Example SVG file:

  https://upload.wikimedia.org/wikipedia/commons/2/2f/Google_2015_logo.svg

Patch by Zac Mullett (aka zmullett), thanks!

Reviewers: sergey

Projects: #addons

Differential Revision: https://developer.blender.org/D1755
2016-02-10 12:08:42 +01:00
2fb7194dba Fix T45460: SVG importer scale issues
Push SVG tag rectangle before calculating the matrix.
This way scale will use proper SVG width and height.
2016-01-08 14:26:25 +05:00
1164b7f957 Fix T42847: SVG importer: incorrectly imports valid SVG files
Filled paths implies having final 'z' command to close the path.
2014-12-09 14:21:05 +05:00
fb01dd9e54 Fix document height parsing when height contains units 2014-05-13 16:47:38 +02:00
852fc1ecce Fix T38324: import SVG from Inkscape doesn't match space origin
Made some tweaks to transformation matrix of <svg> node to make
it so origin from Inkscape matches Blender origin.

Currently only affects files from Inkscape, for others it's not
so much clear what origin should be.

Based on the patch from aldero (juanC), thanks!
2014-01-23 15:38:38 +06:00
ce3f2bfae5 Code cleanup: multiple spaces around keyword 2013-11-15 02:48:24 +06:00
671f515d37 correct typos 2012-11-30 14:40:47 +00:00
bf9f42d9b5 Made SVG importer handle DPI properly
Apparently internally SVG importer was using 90 points per blender unit,
not per inch. This made files importing with unexpectable dimensions
which could be really harmful if you're importing blueprints as references.

Now SVG importer is using 90 points per inch, which makes imported files
has correct dimensions in both Metric and Imperal unit systems.

However, there's one possible downside -- imported files would look
smaller in blender units system.
2012-11-06 13:16:45 +00:00