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

Failed to open material with empty embed texture #1615

Closed
Phyksar opened this issue Mar 27, 2024 · 0 comments
Closed

Failed to open material with empty embed texture #1615

Phyksar opened this issue Mar 27, 2024 · 0 comments
Labels

Comments

@Phyksar
Copy link

Phyksar commented Mar 27, 2024

Describe the bug
Tried to figure out how you would embed a texture inside a material like base/fx/vehicles/common/shadow_mat.mi and now my material isn't even opening.

To Reproduce
Steps to reproduce the behavior:

  1. Copy any material to project.
  2. Create an embed xbm texture by pressing a "plus" icon in the material browser.
  3. Save material with an empty texture because WolvenKit doesn't offer any way to upload an embed texture.
  4. Close and try to open material again, you get an error:
[27.03.2024 8:46:44] [Error    ] Unhandled exception in WolvenKit v8.13.0.0
[27.03.2024 8:46:44] [Error    ] Message: Object reference not set to an instance of an object.
Source: WolvenKit.Common
StackTrace:    at WolvenKit.RED4.CR2W.RedImage.FromXBM(CBitmapTexture bitmapTexture) in D:\a\WolvenKit\WolvenKit\WolvenKit.Common\RED4\RedImage.cs:line 896
   at WolvenKit.RED4.CR2W.RedImage.FromRedClass(RedBaseClass cls) in D:\a\WolvenKit\WolvenKit\WolvenKit.Common\RED4\RedImage.cs:line 873
   at WolvenKit.App.ViewModels.Documents.RDTTextureViewModel..ctor(RedBaseClass data, RedDocumentViewModel file, ILoggerService loggerService, Red4ParserService parserService) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Documents\RDTTextureViewModel.cs:line 42
   at WolvenKit.App.Factories.DocumentTabViewmodelFactory.RDTTextureViewModel(RedBaseClass data, RedDocumentViewModel file) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\Factories\DocumentTabViewmodelFactory.cs:line 43
   at WolvenKit.App.ViewModels.Documents.RedDocumentViewModel.AddTabForRedType(RedBaseClass cls) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Documents\RedDocumentViewModel.cs:line 246
   at WolvenKit.App.ViewModels.Documents.RedDocumentViewModel.PopulateItems() in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Documents\RedDocumentViewModel.cs:line 331
   at WolvenKit.App.ViewModels.Documents.RedDocumentViewModel..ctor(CR2WFile file, String path, AppViewModel appViewModel, IDocumentTabViewmodelFactory documentTabViewmodelFactory, IChunkViewmodelFactory chunkViewmodelFactory, IProjectManager projectManager, ILoggerService loggerService, IOptions`1 globals, Red4ParserService parserService, IWatcherService watcherService, IArchiveManager archiveManager, IHookService hookService, INodeWrapperFactory nodeWrapperFactory, Boolean isReadyOnly) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Documents\RedDocumentViewModel.cs:line 97
   at WolvenKit.App.Factories.DocumentViewmodelFactory.RedDocumentViewModel(CR2WFile file, String path, AppViewModel appViewModel, Boolean isReadOnly) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\Factories\DocumentViewmodelFactory.cs:line 59
   at WolvenKit.App.ViewModels.Shell.AppViewModel.Open(String fullPath, EWolvenKitFile type) in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Shell\AppViewModel.cs:line 1574
   at WolvenKit.App.ViewModels.Shell.AppViewModel.<>c__DisplayClass142_1.<<RequestFileOpen>b__10>d.MoveNext() in D:\a\WolvenKit\WolvenKit\WolvenKit.App\ViewModels\Shell\AppViewModel.cs:line 1793
--- End of stack trace from previous location ---
   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)

Expected behavior
The material browser should open no matter what state of resources it has.

Version (please complete the following information):
8.13.0

@Phyksar Phyksar added the bug label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant