Bug 157532 - ProjectionMode PERSPECTIVE for extruded custom shapes not possible via BASIC macro
Summary: ProjectionMode PERSPECTIVE for extruded custom shapes not possible via BASIC ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:24.2.0 target:7.6.3
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-30 14:22 UTC by Regina Henschel
Modified: 2023-10-21 18:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
document with macro to force projection mode PERSPECTIVE (14.21 KB, application/vnd.oasis.opendocument.presentation)
2023-09-30 14:22 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-09-30 14:22:03 UTC
Created attachment 189907 [details]
document with macro to force projection mode PERSPECTIVE

Open attached document. It contains a macro to change the projection mode to PERSPECTIVE. But the shape stays in projection mode PARALLEL.

To run the macro press Alt+F11. Expand the library of the attached document and run "ForcePerspective" macro. The dialog has also an "Edit" button to inspect the macro.

I see the same problem in AOO. Thus I have set 'Inherited from OOo'.

The problem is described in https://ask.libreoffice.org/t/basic-macro-api-extrusion-perspective/96284/5
The problem is also mentioned in https://forum.openoffice.org/en/forum/viewtopic.php?t=83526
Comment 1 Julien Nabet 2023-10-03 20:36:59 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

I noticed this part:
Thread 1 "soffice.bin" hit Breakpoint 1, EnhancedCustomShape3d::Create3DObject (pShape2d=0x557c2f557360, rSdrObjCustomShape=...) at svx/source/customshapes/EnhancedCustomShape3d.cxx:333
333	        drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL );
(gdb) n
334	        const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" );
(gdb) n
335	        if ( pAny )
(gdb) n
336	            *pAny >>= eProjectionMode;
(gdb) p *pAny
$1 = uno::Any("byte": 1 '\001')

Also, I noticed there's ProjectionMode defined here:
https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/drawing/ProjectionMode.idl?r=5687eba4
27 published enum ProjectionMode
28 {
29     /** the 3D objects are drawn in the parallel projection.
30      */
31     PARALLEL,
32     /** the 3D objects are drawn in the perspective projection.
33      */
34     PERSPECTIVE
35 
36 };

and "ProjectionType"
enum class ProjectionType { Parallel, Perspective };
(see https://opengrok.libreoffice.org/xref/core/include/svx/viewpt3d.hxx?r=ff546a5d&mo=1414&fi=38#38)

It seems there's some redundancy here and wonder if we should remove ProjectionType to make this clearer.
Comment 2 Julien Nabet 2023-10-06 07:12:41 UTC
I wanted to compare with ShadeMode (see https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/drawing/ShadeMode.idl?r=5687eba4) but it seems we got the same pb.
Comment 3 Julien Nabet 2023-10-06 15:23:19 UTC
https://gerrit.libreoffice.org/c/core/+/157654
Comment 4 Julien Nabet 2023-10-06 15:30:25 UTC
For ShadeMode:
https://gerrit.libreoffice.org/c/core/+/157655
Comment 5 Commit Notification 2023-10-06 18:04:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f1aa554cd0b471e0c9424ece7ab3d9b3d7723a1d

tdf#157532: deal "ProjectionMode" for extruded custom shapes via BASIC macro

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Julien Nabet 2023-10-06 18:04:48 UTC
Patch for 7.6 waiting for review:
https://gerrit.libreoffice.org/c/core/+/157623
Comment 7 Commit Notification 2023-10-07 07:57:48 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cc81d424a29dd4b421bc1775faaa51c58195fadc

Related tdf#157532: deal "ShadeMode" for extruded custom shapes via BASIC macro

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2023-10-21 15:32:10 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/03d40c7e9cb377a1aa93a431f8f670f78aa6fe38

Related tdf#157532: deal "ShadeMode" for extruded custom shapes via BASIC macro

It will be available in 7.6.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2023-10-21 15:32:12 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/249751d2bc4c6c6704c00c83a807a3a0c0a31288

tdf#157532: deal "ProjectionMode" for extruded custom shapes via BASIC macro

It will be available in 7.6.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.