space928 / Blender-O3D-IO-Public

A plugin supporting blender 2.79.x-3.x.x for importing and exporting OMSI .sco, .cfg, and .o3d files
GNU General Public License v3.0
36 stars 5 forks source link

light env maps appear at the wrong place #60

Open FreeHK-Lunity opened 1 year ago

FreeHK-Lunity commented 1 year ago

Describe the bug

these lights are supposed to be at the front. It appeared at top. refer to screenshot

To Reproduce

Steps to reproduce the behaviour: [Be sure to attach any relevant files (o3d, cfg, dds, etc...) to the issue or provide a link to them here] https://drive.google.com/file/d/1nv-le9cbYsFgItK5lRCwGYVhCUrFLAyN/view?usp=sharing import any model cfgs see for yourself

Expected behaviour

the light env maps to be at where they are supposed to be in

Screenshots

image image

Additional context

FreeHK-Lunity commented 1 year ago

it seems that all the lights are wrong image

space928 commented 1 year ago

Hi, I believe I fixed this bug a little while ago. Can you make sure you're using the latest version of the plugin please. On my end it works fine: [image: image.png] Best,

On Tue, 9 May 2023 at 12:47, Chan Hon Leung Edward @.***> wrote:

it seems that all the lights are wrong [image: image] https://user-images.githubusercontent.com/67418738/237086391-536c8884-78d5-4246-a303-06b5f6a4525b.png

— Reply to this email directly, view it on GitHub https://github.com/space928/Blender-O3D-IO-Public/issues/60#issuecomment-1540008919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTN4AQY22ASUI6NYMLOOHDXFIVEDANCNFSM6AAAAAAXZ5FYTA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Thomas

FreeHK-Lunity commented 1 year ago

I dont think you have fixed it. I'm using the latest version and the lights still appear at the wrong place image

FreeHK-Lunity commented 1 year ago

圖片

FreeHK-Lunity commented 10 months ago

works in latest beta

jem-suu commented 9 months ago

This still occurs to me even in the latest 1.2.2 beta (on Blender versions 3.3.6 and 3.6.2), but I kinda realize why it's happening.

Each object generated by a light entry is either being parented to the last mesh in the config before the entries, or has a reference point related to said last mesh, meaning that they are rotated according to the position and rotation of said mesh.

In this example, with the MS_Veiling, all the exterior light sources are parented to the RGrilleCutout.o3d mesh, which for some reason rotates them all in the wrong axis and parents them to said mesh. This is easily fixable though. image blender_2023-09-20_15-22-59

In another example, the SP 400MMC has an LOD tag, which seperates it out in blender, but since the last mesh before any light entries is RIBAS_5.o3d, every single light source and sprite takes the rotation from it, rather than taking the defined coordinates in each entry. Code_2023-09-20_15-21-52 blender_2023-09-20_15-04-00 blender_2023-09-20_15-04-08

The solution I've found is to clear the parents of the generated light objects manually in blender, and they would be put back into the correct positions. This weird functionality, however, is useful for any light entries that are attached to meshes: for example, a light entry for a light on a switch.

This most likely explains the behaviour, but it is understandable, as some light sources can be made to follow objects whilst animated (as I have taken advantage of in my projects) but hopefully this offers an explanation to what is happening and how to fix it.

space928 commented 9 months ago

I'll investigate this as soon as I have a bit more free time.