Comments (10)
No, that is definitely not intended behaviour - it's been a while though since I implemented it, so I'll have to take a look tomorrow. Thanks for reporting
from node_editor_framework.
FYI here is the relevant implementation
from node_editor_framework.
Thank you very much, I'm taking a look into it as well.
The main thing I'm confronting is that my nodes have several drop-down menus in the form of either enums (using RTEditorGUI.EnumPopup(Enum val)) or strings (using RTEditorGUI.Popup(string[], index). I'll set these drop downs to some value or another, export to XML, re-import and the values will not have been saved.
Based on the implementation of ReflectionUtility.getSerializedFields() I thought perhaps the issue was that I was not marking the popup index vals as serialized. However I just ran a test by marking those values as serialized before exporting and it doesn't seem to make a difference.
from node_editor_framework.
Found the issue. On the XML export process, obj.GetType().GetField(fieldName) is failing to find every field that is NOT a string. It fails to find int field, fails to find bool field, fails to find enum field: https://github.com/Seneral/Node_Editor_Framework/blob/develop/Node_Editor/Default/IO%20Formats/XMLImportExport.cs#L308
from node_editor_framework.
Ok so just tested myself on windows, Unity 2017.4.24f1 and it works fine. If you can tell me your version I'll test that as well, might be some changes broke things. Am I right to assume that the coded warning popped up or an error?
Edit: Found a bug where it would fail to find the variable when it's private but with [SerializeField] - XML-IO assumes all serializable variables to be public. Could that be related, although you also said it failed in the default example?
from node_editor_framework.
I was just coming here to mention that if I make the fields public it works correctly. I was surprised to find that [SerializeField] did not have the same effect. I also tried passing BindingsFlags.NonPublic but that did not help either. Only using Public has worked so far.
And yes, I also saw the fields not saving in the calc. graph. I'm using 2019.1.13f1
from node_editor_framework.
Just noticed it isn't even meant to refetch the variable value at all - that is done during creation of the structured data beforehand. So just change this to:
else // Serialize value-type fields in-line
{
XmlElement serializedValue = SerializeObjectToXML(node, varData.value);
serializedValue.SetAttribute("name", varData.name);
}
That should work (only for export, error will still appear on import) - although I'm still not sure what causes the error for you on the default nodes... Maybe they made the BindingFlags necessarily explicit on newer versions? Not really up to date with unity versions anymore unfortunately
from node_editor_framework.
With 1bbb287 private [SerializeField] fields work for me now. Can you check if that fixes your issue with the CaluclationCanvas as well?
Will check in 2019 now
from node_editor_framework.
Ok finally got around to try in 2019.1. I'm still not getting the field not found error on line 308 - but a serialization error in line 363. Seems the way XMLSerializer works changed with Net 4.x, it will now always call a method that will throw an error even though it knows it would throw an error...
Workaround added in 19f0059
Does that fix it for you now? Works fine for me in 2019.1 now
from node_editor_framework.
That solved it! Excellent work. Thank you for being so responsive.
from node_editor_framework.
Related Issues (20)
- The connections will miss when I add a new node. HOT 2
- GUIScaleUtility.cs Init Method NullReferenceException in Unity 2019.1.2f1 HOT 10
- Insane Bug from using RTEditorGUI.EnumPopup() HOT 3
- Is Project Active and Package Support? HOT 15
- `PlayModeStateChange' could not be found. Are you missing a using directive or an assembly reference? HOT 3
- [Solved] Context menu not showing up. HOT 2
- Multiple instances of node editors open at once HOT 1
- Toolbar is not showing up HOT 4
- All data is lost when I change the scene, even though I have extra saved as an asset file HOT 4
- How to input multiple outputs to a node? HOT 8
- Apple M1 computers not displaying Bezier curves HOT 3
- Added one node. Then it stoped working. (Remove the node, re-install, sitll not working) Unity 2020.2 LTS
- Implementation of a Logic Graph HOT 7
- XML import issue on UWP
- I deleted the ScriptableObjects in Assets/DefaultEditorResources/Node_Editor_Framework HOT 3
- Making children of node drag along with parent HOT 5
- Functional Nodes that are not tied to the Node Editor Window HOT 6
- Loading canvas based on Selection.activeTransform? HOT 4
- seems undo pro doesnt work with unity 2022.2.8 not sure what version it stopped working at HOT 5
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 node_editor_framework.