Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Implement material browser window #287

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
dfe3817
Implement material browser window
kerfuffles Sep 28, 2020
de25960
Use a deferred job system to render asset thumbnails and start work o…
kerfuffles Sep 30, 2020
4919d50
rename StoredEntry -> Cached thumbnail. naming makes more sense
kerfuffles Oct 2, 2020
44cadad
squish a bug, now loads the cache
kerfuffles Oct 4, 2020
2acaeab
Merge branch 'master' into material-browser
kerfuffles Oct 4, 2020
566c03a
make names match convention of the rest of the project
kerfuffles Oct 5, 2020
ab47091
use instance ID instead of name for checking if an entry is valid
kerfuffles Oct 5, 2020
8af8fb1
fix file headers
kerfuffles Oct 5, 2020
8dffcf7
swap label bar to the right side.
kerfuffles Oct 5, 2020
9fa8ca9
testing stuff
kerfuffles Oct 5, 2020
87136b3
begin trying to get tabs to rotate
kerfuffles Oct 7, 2020
492220e
start work on converting test window to UIElements
kerfuffles Oct 9, 2020
7d1e7fc
Update ChiselMaterialBrowserWindowLayoutTest.cs
kerfuffles Oct 9, 2020
b267cce
finish converting window to IU Toolkit
kerfuffles Oct 13, 2020
a4a3c3f
wew laddie, that was a wild ride
kerfuffles Oct 20, 2020
7f87610
clean up some per-frame allocations
kerfuffles Oct 21, 2020
c63a947
big changes
kerfuffles Oct 22, 2020
9457b38
Update ProjectVersion.txt
kerfuffles Oct 22, 2020
4838a97
Merge branch 'master' into material-browser
kerfuffles Oct 22, 2020
499a73a
Update .gitignore
kerfuffles Oct 22, 2020
68d1a87
did some optimizng of memory performance, added culling of tiles not …
kerfuffles Oct 26, 2020
7b96dce
Merge branch 'master' into material-browser
kerfuffles Jan 31, 2021
7d3c26d
Clean up code, simplify some things
kerfuffles Jan 31, 2021
d3f6f04
Add tile label toggle functionality, fix small tiles having labels, a…
kerfuffles Jan 31, 2021
d391bec
Implement changing surface material.
kerfuffles Jan 31, 2021
211d98a
Add a simple test case for editing surfaces, and a complex scene.
kerfuffles Jan 31, 2021
3bd2db5
Revert packages-lock.json change, brain fart moment.
kerfuffles Jan 31, 2021
ca50f27
Add message to browser to notify the user when theyre in playmode and…
kerfuffles Feb 1, 2021
17cda36
Bugfix to fix a nullref when changing editor themes.
kerfuffles Feb 1, 2021
e3268bb
Improve preview rendering
cr4yz Feb 9, 2021
2a13934
Merge pull request #3 from cr4yz/material-browser
kerfuffles Feb 9, 2021
27eff0f
Add rider plugin
kerfuffles Feb 11, 2021
76368cb
Clean up UI, optimize parts of tile rendering, and add name search
kerfuffles Feb 11, 2021
6e23786
Remove debug code as its no longer needed
kerfuffles Feb 11, 2021
b5e8925
Add dark/light theme support, farther UI adjustments
kerfuffles Feb 11, 2021
ebe3ec7
code cleanup
kerfuffles Feb 11, 2021
3b8a3e5
More code cleanup, remove unused code from ChiselEmbeddedTextures
kerfuffles Feb 11, 2021
f32e15a
Add dropdown to filter for materials used in the scene on ChiselModels
kerfuffles Feb 11, 2021
5593aa5
Clean up and comment code, fix some layout issues, cache reflected me…
kerfuffles Feb 11, 2021
41dd7f5
Hook EditorApplication.projectChanged to add/remove materials when th…
kerfuffles Feb 12, 2021
0136cb2
Remove meta that didnt get removed in last commit
kerfuffles Feb 12, 2021
2bb4c18
Begin work on surface presets
kerfuffles Feb 12, 2021
5032cd8
Merge branch 'RadicalCSG:master' into material-browser
kerfuffles Jun 5, 2021
fd16d73
Merge branch 'unity-2021.1.10f1-project-update' into material-browser
nukeandbeans Jun 15, 2021
8b0f982
add jb rider package
nukeandbeans Jun 15, 2021
fa02ef1
Rewrite tile filters, remove surface presets, modularize tiles
nukeandbeans Jun 23, 2021
8251960
Update file headers, clean some code up, added comments in places whe…
nukeandbeans Jun 24, 2021
806b1d0
update file headers, remove unused code
nukeandbeans Jun 24, 2021
4a0ec07
Merge branch 'master' into material-browser
nukeandbeans Jul 12, 2021
a74a503
Merge branch 'master' into material-browser
kerfuffles Aug 26, 2021
69e49d2
Merge branch 'RadicalCSG:master' into material-browser
kerfuffles Dec 9, 2021
6dd13fc
Merge branch 'master' into material-browser
kerfuffles Dec 9, 2021
183eaeb
adjust code style, update some code for readability, label bugs or ot…
kerfuffles Dec 9, 2021
7bf3c9c
API Changes
kerfuffles Dec 18, 2021
4cdacf2
Merge branch 'master' into material-browser
kerfuffles Jun 11, 2022
4703d6d
Merge branch 'master' into material-browser
kerfuffles Jun 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ UIElementsSchema/
# temporary (remove me before merging material browser PR)
nukeandbeans marked this conversation as resolved.
Show resolved Hide resolved
/Assets/Surfaces Beta 0.4/
/Assets/Surfaces Beta 0.4.meta
/UserSettings

.vsconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* * * * * * * * * * * * * * * * * * * * * *
Chisel.Editors.ChiselMaterialBrowserTile.cs

URL: https://github.com/RadicalCSG/Chisel.Prototype
License: MIT (https://tldrlegal.com/license/mit-license)
Author: Daniel Cornelius
Author: Daniel Cornelius

Generic base class for getting thumbnail previews for use in IMGUI
* * * * * * * * * * * * * * * * * * * * * */

using System;
Expand All @@ -12,12 +12,12 @@

namespace Chisel.Editors
{
internal class ChiselMaterialBrowserTile : IDisposable
internal class ChiselAssetPreviewTile<T> : IDisposable where T : UnityEngine.Object
{
public readonly string path;
public readonly string guid;
public readonly string shaderName;
public readonly string materialName;
public readonly string assetName;
public readonly string[] labels;
public readonly int id;

Expand All @@ -34,31 +34,37 @@ public bool CheckVisible( float yOffset, float thumbnailSize, Vector2 scrollPos,
{
if( scrollPos.y + scrollViewHeight < ( yOffset - thumbnailSize ) ) return false;
if( yOffset + thumbnailSize < scrollPos.y ) return false;

return true;
}

public void RenderPreview()
{
// dont include specific materials
// dont include specific assets
if( ( m_Preview && m_Preview != AssetPreview.GetMiniTypeThumbnail( typeof( Material ) ) )
|| AssetPreview.IsLoadingAssetPreview( id )
|| materialName.Contains( "Font Material" )
|| !ChiselMaterialBrowserUtilities.IsValidEntry( this ) ) { return; }
|| !ChiselMaterialBrowserUtilities.IsValidEntry( this ) )
{
return;
}

m_Preview = ChiselMaterialBrowserUtilities.GetAssetPreviewFromGUID( guid );
}

public ChiselMaterialBrowserTile( string instID )
public ChiselAssetPreviewTile( string instID )
{
path = AssetDatabase.GUIDToAssetPath( instID );

Material m = AssetDatabase.LoadAssetAtPath<Material>( path );
T asset = AssetDatabase.LoadAssetAtPath<T>( path );

id = asset.GetInstanceID();
guid = instID;
labels = AssetDatabase.GetLabels( asset );

if( asset is Material material )
shaderName = material.shader.name;

id = m.GetInstanceID();
guid = instID;
labels = AssetDatabase.GetLabels( m );
shaderName = m.shader.name;
materialName = m.name;
assetName = asset.name;

RenderPreview();
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* * * * * * * * * * * * * * * * * * * * * *
URL: https://github.com/RadicalCSG/Chisel.Prototype
License: MIT (https://tldrlegal.com/license/mit-license)
Author: Daniel Cornelius

Static class for textures commonly used within Chisel
* * * * * * * * * * * * * * * * * * * * * */

using System;
using UnityEditor;
using UnityEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* * * * * * * * * * * * * * * * * * * * * *
Chisel.Editor.ChiselMaterialBrowserTab.cs

License: MIT (https://tldrlegal.com/license/mit-license)
Author: Daniel Cornelius
Date: 2/11/2021 @ 1:56 PM
URL: https://github.com/RadicalCSG/Chisel.Prototype
License: MIT (https://tldrlegal.com/license/mit-license)
Author: Daniel Cornelius

Used in ChiselMaterialBrowserWindow for choosing what
kind of content to show to the user
* * * * * * * * * * * * * * * * * * * * * */

namespace Chisel.Editors
Expand All @@ -13,6 +13,6 @@ public enum ChiselMaterialBrowserTab
{
All = 0,
Used = 1,
Surfaces = 2,
//Surfaces = 2,
}
}

This file was deleted.

Loading