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

Int3 as component property causes GS to crash #383

Closed
boriscallens opened this issue Feb 17, 2019 · 5 comments · Fixed by #387
Closed

Int3 as component property causes GS to crash #383

boriscallens opened this issue Feb 17, 2019 · 5 comments · Fixed by #387
Assignees
Labels
bug

Comments

@boriscallens
Copy link

@boriscallens boriscallens commented Feb 17, 2019

Release Type: Official Release

Version: 3.1.0.1-beta01-0441

Platform(s): Windows

Describe the bug
Adding a component property of the type Xenko.Core.Mathematics.Int3 causes Game Studio to crash with a confusing exception log upon attaching to any entity.

To Reproduce
Steps to reproduce the behavior:
Repro here: https://github.com/boriscallens/XenkoBuildRepro

  1. Create a default game
  2. Create a basic component
    [DataContract("MyComponent")]
    public class MyComponent: EntityComponent
    {
    // public Vector3 Working { get; set; }
    public Int3 Crashing { get; set; }
    }
  3. Attach the component to any entity in the default scene in Game Studio

Expected behavior
The component is added to the entity and a Crashing property of the type int3 is editable on the component.
Alternatively/complementary a helpful error message and placeholder Unloadable component. Keeping GS functional for editing.
Alternatively a more helpful exception / stacktrace

Screenshots
N/A

Log and callstacks
buildLog.txt

Additional context
Maybe it has nothing to do with the type, but with the editor ui component?
That would explain the stacktrace pointing to XamlParseException: Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception.
From comparing the Int3 implementation with the Vector3 implementation I couldn't identify any relevant differences.

@boriscallens boriscallens added the bug label Feb 17, 2019
@Kryptos-FR

This comment has been minimized.

Copy link
Collaborator

@Kryptos-FR Kryptos-FR commented Feb 17, 2019

The crash in Xaml UIElement probably means the template for the editor of Int3 has some issues.

If someone wants to investigate, the culprit could be in file https://github.com/xenko3d/xenko/blob/master/sources/presentation/Xenko.Core.Presentation/Themes/ExpressionDark/Theme.xaml#L4199 (at least that's a good starting point).

@dfkeenan

This comment has been minimized.

Copy link
Contributor

@dfkeenan dfkeenan commented Feb 18, 2019

Not sure if this is the problem but the Int<X>Editors don't override the default style key where as all the Vector<X>Editors do. i.e. https://github.com/xenko3d/xenko/blob/master/sources/presentation/Xenko.Core.Presentation/Controls/Vector3Editor.cs#L32

@Kryptos-FR

This comment has been minimized.

Copy link
Collaborator

@Kryptos-FR Kryptos-FR commented Feb 18, 2019

To help investigate property grid issues, we have that test asset that can be used: https://github.com/xenko3d/xenko/blob/master/sources/editor/Xenko.Assets.Presentation/Test/TestAsset.cs

Note that it currently doesn't include IntX properties, which could be a good addition.

@dfkeenan

This comment has been minimized.

Copy link
Contributor

@dfkeenan dfkeenan commented Feb 18, 2019

There is an extra /> on line 4229 of that theme file.

WatermarkContentTemplate="{Binding WatermarkContentTemplate, RelativeSource={RelativeSource Mode=TemplatedParent}}"/> />

Deleting it fixes it.

@Kryptos-FR Kryptos-FR self-assigned this Feb 18, 2019
@Kryptos-FR Kryptos-FR mentioned this issue Feb 18, 2019
3 of 7 tasks complete
@xen2 xen2 closed this in #387 Feb 19, 2019
xen2 added a commit that referenced this issue Feb 19, 2019
phr00t added a commit to phr00t/FocusEngine that referenced this issue Feb 19, 2019
[Presentation] Bugfix/int3 editor (xenko3d#387) (fixes xenko3d#383)
@boriscallens

This comment has been minimized.

Copy link
Author

@boriscallens boriscallens commented Feb 25, 2019

Do fixes to Game Studio also get pushed through nuget somehow or is this a more involved process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.