Comments (6)
- functions of filters
Yes, Filter node’s GUI function is very limited.
You can define your own Filter node.(not yet documented, but plan is exists.)
sample code is below.
AssetGraph aims to supply easy way for controlling Assets by default.
And, supply customizable nodes for complex usage.
- no way to implement inspectors
Yes,,, Around the Inspector it is very complex .
(Undo, Graph’s DataBinding, and Designing GUI.)
There is no plan about this.
・implement a node which adds components to a prefab built by prefabricator
How about this?
// This code is arrange of CreateCharaPrefab.cs https://github.com/unity3d-jp/AssetGraph/blob/master/Assets/AssetGraph/UserSpace/Examples/Editor/CreateCharaPrefab.cs
public class CreateCharaPrefab2 : AssetGraph.PrefabricatorBase {
public override void In (string groupKey, List<AssetGraph.AssetInfo> source, string recommendedPrefabOutputDir, Func<GameObject, string, bool, string> Prefabricate) {
// ... omitted ... //
// for example, instantiate model.
var modelObj = GameObject.Instantiate(charaModel);
// add component to it.
modelObj.AddComponent<Rigidbody>();
// then Prefabricate(object, string, bool) method makes prefab for it.
var prefabName = groupKey + "_chara.prefab";
var prefabOutputPath = Prefabricate(modelObj, prefabName, false);
// delete unnecessary chara model from hierarchy.
GameObject.DestroyImmediate(modelObj);
}
}
- want to move cache objects out side of Assets/ folder
is “cache” means AssetGraph’s Cache folder? or cache of AssetGraph itself?
from assetgraph.
- about custom filters and custom node inspector
Is it difficult to introduce following IBaseNode.OnInspectorGUI() virtual method mechanism for custom node inspector ?
public class CustomRegexFilter : AssetGraph.FilterBase { private string pattern = "/monster.*fbx$"; public override void In(List source, Action> Out) { Out("out", source.Where(s => Regex.IsMatch(s, pattern)).ToList()); } // **** called from AssetGraph's OnInspectorGUI() **** public override void OnInspectorGUI() { pattern = EditorGUILayout.TextField("regex pattern", pattern); } }
I think that AssetGraph need not support all editor functions for customized (out side of AssetGraph) nodes.
- CreateCharaPrefab2
I think CreatecharaPrefab2 is good, but I want to separate prefablication and component settings because component settings tend to be more complex than prefablication itself.
Is it possible to introduce like 'PostPrefablicator' node?
- is “cache” means AssetGraph’s Cache folder? or cache of AssetGraph itself?
I meant AssetGraph's Cache folder. If too many assets are in AssetGraph's Cache folder, sharing a project between team members may be cumbersome.
from assetgraph.
- CreateCharaPrefab2
Separating steps is very good idea.
How about using one more Prefabricator for modify prefab? The Prefabricator node is able to run specific code.
Set 2 Prefabricator nodes, 1st is for generating prefab. 2nd is for adding component to exist prefab.
step by step,
- generate prefab in Prefabricator_1.
- In Prefabricator_2, instantiate already exist prefab.
- add component to prefab
- re-generate prefab
codes here.
// This code is arrange of CreateCharaPrefab.cs https://github.com/unity3d-jp/AssetGraph/blob/master/Assets/AssetGraph/UserSpace/Examples/Editor/CreateCharaPrefab.cs
public class CreateCharaPrefab3 : AssetGraph.PrefabricatorBase {
public override void In (string groupKey, List<AssetGraph.AssetInfo> source, string recommendedPrefabOutputDir, Func<GameObject, string, bool, string> Prefabricate) {
// ... omitted ... //
// instantiate prefab(already generated by other Prefabricator).
var prefabObj = GameObject.Instantiate(yourPrefab);
// add component to it.
prefabObj.AddComponent<Rigidbody>();
// then Prefabricate(object, string, bool) method makes prefab for it.
// In this case, you have already 1 prefab & want to update it.
// use true for 3rd parameter of Prefabricate method.
// it means “overwrite if same name prefab is exists.”
var prefabName = groupKey + "_chara.prefab";
var prefabOutputPath = Prefabricate(prefabObj, prefabName, true);
// delete unnecessary prefab instance from hierarchy.
GameObject.DestroyImmediate(prefabObj);
}
}
from assetgraph.
- about AssetGraph’s Cache folder
sharing a project between team members may be cumbersome
Yes, if try out such a thing, it is not easy.
AssetGraph is the asset that “generate resources for the project in 1 place”.
1 place means “The workspace of member who manage game resources for release”.
I recommend to share only generated assets between teams. Not whole resources of AssetGraph.
And so, The reason why AssetGraph has resources in Assets/AssetGraph/Cache folder is for specification of Unity’s AssetDatabase.
Using resources in UnityEditor requires the recorded GUID of assets. These Ids are recorded by AssetDatabase. and AssetDatabase treats only assets which are located in Assets/ folder.
from assetgraph.
- about custom filters and custom node inspector
// **** called from AssetGraph's OnInspectorGUI() ****
public override void OnInspectorGUI() {
pattern = EditorGUILayout.TextField("regex pattern", pattern);
}
}
Looks nice, but a lifetime of Node instance is not matched to Editor GUI.
There is no dependency between Node-code to GUI now, and this separation is intended.
Thank you.
from assetgraph.
Set 2 Prefabricator nodes, 1st is for generating prefab. 2nd is for adding component to exist prefab.
Looks good, I will try it. Thank you !
1 place means “The workspace of member who manage game resources for release”.
I recommend to share only generated assets between teams. Not whole resources of AssetGraph.
I understand. I will try with this in mind.
Looks nice, but a lifetime of Node instance is not matched to Editor GUI.
There is no dependency between Node-code to GUI now, and this separation is intended.
I understand. It looks difficult.
Thanks for clear explanations, I close this issue.
from assetgraph.
Related Issues (20)
- Incoming AssetGroups are null inside of `Prepare`
- AssetGraph isn't procedural asset generation friendly
- Renaming Custom Nodes/Modifiers/AssetGenerators Causes Exceptions
- Test assets cause Unity Editor stuck and huge gc when save asset
- Extract Shared Assets HOT 1
- Override Import Setting doesn't work HOT 4
- Importing never ends when installed with Entities 0.2.0 package
- (Addressabes/Set Asset Group) leads wrong totalAssets amount HOT 2
- Development Question
- Asset GUID change caused problem
- The API documentation is Not Found.
- Package not found HOT 5
- Split By FilterのFilter ConditionsのTextorBinaryの挙動について
- ModelImportSettingsConfiguratorについて
- ノード構成によってグラフが逆流します
- How to add addressables nodes in version 1.7.2
- EditorでPlayを停止後、再度Playすると毎回30秒ほどCacheImport処理が走り待たされる
- Use As Postprocessor Not work
- Could you support to Unity 2022 LTS?
- 升级unity到2022后报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assetgraph.