Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom scale doesn't apply to ASS files #62

Open
jadshep opened this issue Aug 8, 2022 · 5 comments
Open

Custom scale doesn't apply to ASS files #62

jadshep opened this issue Aug 8, 2022 · 5 comments

Comments

@jadshep
Copy link
Contributor

jadshep commented Aug 8, 2022

Whenever I've tried to use a custom scale with level structures I've noticed that everything comes out the expected size, but with the wrong positions. After a very quick look I've found this section:

if file_type == 'JMS':
scale_x = Matrix.Scale(custom_scale, 4, (1, 0, 0))
scale_y = Matrix.Scale(custom_scale, 4, (0, 1, 0))
scale_z = Matrix.Scale(custom_scale, 4, (0, 0, 1))
scale_matrix = scale_x @ scale_y @ scale_z
position = position @ scale_matrix

If I change the if to include 'ASS':
if file_type == 'JMS' or file_type == 'ASS':

It seems to work as expected (at least for my simple test scene). I'm not sure if this breaks something else or if it's the only section of code that needs changing to fully fix the issue.

@General-101
Copy link
Owner

That's like that because ASS has a scale value in the format. Scale from the object gets written there and the unscaled object dimensions are written to the file.

Proper fix would be to make sure the scale value written is correct after using a custom scale value.

@jadshep
Copy link
Contributor Author

jadshep commented Aug 21, 2022

Looking at the code I can't see anywhere the custom scale is applied to the file.

Here's a test scene .blend:
Scale Test.zip

The custom scale is set to 10. When I export to ASS and import into a scenario the sizes of everything look right, just the positions are off.

image
image

@jadshep
Copy link
Contributor Author

jadshep commented Aug 21, 2022

The scale was 10 above, but if I drop it to 2 (and scale the scene by 5X in blender) they are much closer to the correct positions. This lines up with the positions just not being affected by the scale.

image

The scene is correct in Sapien with the change mentioned in the initial issue.

@jackrabbit72380
Copy link

all i did was make the map biger and blender crashed with error related to toolset

F
An unhandled exception has occurred!
System.InvalidOperationException: Process was not started by this object, so requested information cannot be determined.
at System.Diagnostics.Process.EnsureState(State state)
at
ToolkitLauncher.Utility.Process.Windows.<>c__DisplayClass2_0.<<StartProcessW
ithShell>g_Handle Process|0>d.MoveNext()
End of stack trace from previous location ---
at ToolkitLauncher.Utility.Process.Windows.StartProcessWithShell(String directory, String executable, String args, Boolean lowPriority, InjectionConfig injectionOptions, CancellationToken cancellationToken)
at ToolkitLauncher.Utility.Process.StartProcessWithShell(String directory, String executable, List`1 args, Boolean lowPriority, InjectionConfig injectionOptions, CancellationToken cancellationToken)
at ToolkitLauncher.Toolkit Interface.ToolkitBase.RunToolInternal(ToolType tool, List`1 args, Nullable`1 outputMode, Boolean lowPriority, InjectionConfig injectionOptions, CancellationToken cancellationToken)
at Toolkit Launcher.ToolkitInterface.ToolkitBase.RunTool (ToolType tool, List`1 args, Nullable`1 outputMode, Boolean lowPriority, InjectionConfig injectionOptions, CancellationToken cancellationToken)
at
ToolkitLauncher.Toolkit Interface.H3Toolkit.<>c__DisplayClass11_0.<<FauxLocalF
arm>g RunFastool|0>d.MoveNext()
at
End of stack trace from previous location ---
ToolkitLauncher.Toolkit Interface.H3Toolkit.<>c__DisplayClass11_0.<<FauxLocalF
arm>g RunStage|1>d.MoveNext()
End of stack trace from previous location -
at Toolkit Launcher.Toolkit Interface.H3Toolkit.FauxLocalFarm(String scenario, String bsp, String lightmapGroup, String quality, Int32 clientCount, Boolean ruseFast, OutputMode mode, ICancellable Progress 1 progress)
at Toolkit Launcher.Toolkit Interface.H3Toolkit.Build Lightmap(String scenario, String bsp, LightmapArgs args, ICancellable Progress 1 progress)
at ToolkitLauncher.MainWindow.CompileLevel(String level_path, String bsp_path, String Level_Quality, Single level_slider, Boolean
radiosity_quality_toggle, Int32 instance_count, Boolean phantom_fix, String lightmap_group, String lightmapper_globals)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
OK
Cancel

@General-101
Copy link
Owner

Please post that in the Osoyoos github as a new issue. Not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants