unity-technologies / giles Goto Github PK
View Code? Open in Web Editor NEWGILES: A Runtime Level Editor for Unity3D
License: Other
GILES: A Runtime Level Editor for Unity3D
License: Other
Using Unity 5.5.0.b7
Error: Assets/GILES/Code/Classes/Serialization/Converters/pb_ObjectContainerConverter.cs(23,43): error CS1980: Dynamic keyword requires `System.Runtime.CompilerServices.DynamicAttribute' to be defined. Are you missing System.Core.dll assembly reference?
I got this error in the console while trying to save a scene from GILES.
I have a (single) kinda complex prefab, but all submeshes should be fine to serialize.
Is there a way I could work around this error?
I tried to build a 64bits version, but the same error appears.
OutOfMemoryException: Out of memory
System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/StringBuilder.cs:725)
System.Text.StringBuilder.Append (System.Char[] value, Int32 startIndex, Int32 charCount) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Text/StringBuilder.cs:480)
System.IO.StringWriter.Write (System.Char[] buffer, Int32 index, Int32 count) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StringWriter.cs:142)
Newtonsoft.Json.JsonTextWriter.WriteIndent ()
Newtonsoft.Json.JsonWriter.AutoComplete (JsonToken tokenBeingWritten)
Newtonsoft.Json.JsonWriter.InternalWritePropertyName (System.String name)
Newtonsoft.Json.JsonTextWriter.WritePropertyName (System.String name)
Newtonsoft.Json.Linq.JProperty.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JObject.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JArray.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JProperty.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json.Linq.JObject.WriteTo (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter[] converters)
GILES.Serialization.pb_MeshConverter.WriteObjectJson (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.JsonSerializer serializer) (at Assets/GILES/Code/Classes/Serialization/Converters/pb_MeshConverter.cs:47)
GILES.Serialization.pb_UnityTypeConverter`1[T].WriteJson (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.JsonSerializer serializer) (at Assets/GILES/Code/Classes/Serialization/Converters/pb_UnityTypeConverter.cs:29)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable (Newtonsoft.Json.JsonWriter writer, Newtonsoft.Json.JsonConverter converter, System.Object value, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary (Newtonsoft.Json.JsonWriter writer, IDictionary values, Newtonsoft.Json.Serialization.JsonDictionaryContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty)
UnityEngine.EventSystems.EventSystem:Update()
pb_Gizmo icons aren't rendering anymore in Unity 5.3. This is a regression (they do render in Unity 5.0).
Is GILES likely to work with touch input from devices like iPads?
I've been using Giles and the "Play Custom Map" will seemingly randomly spit out this error when loading a particular level. This level would load fine just 5 minutes ago.
InvalidOperationException: Current error context error is different to requested error. Newtonsoft.Json.Serialization.JsonSerializerInternalBase.GetErrorContext (System.Object currentObject, System.Object member, System.String path, System.Exception error) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:93) Newtonsoft.Json.Serialization.JsonSerializerInternalBase.IsErrorHandled (System.Object currentObject, Newtonsoft.Json.Serialization.JsonContract contract, System.Object keyValue, IJsonLineInfo lineInfo, System.String path, System.Exception ex) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalBase.cs:111) Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:182) Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:823) Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonSerializer.cs:802) Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:865) Newtonsoft.Json.JsonConvert.DeserializeObject[pb_SceneNode] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) (at C:/Users/George/Downloads/Json.Net.Unity3D-master/Json.Net.Unity3D-master/src/Newtonsoft.Json/JsonConvert.cs:822) GILES.pb_Scene.LoadLevel (System.String levelJson) (at Assets/Lib Assets/GILES/Code/Scripts/pb_Scene.cs:157) GILES.Example.pb_SceneLoader.OnLevelWasLoaded (Int32 i) (at Assets/Lib Assets/GILES/Code/Scripts/pb_SceneLoader.cs:47)
I've loaded levels and they usually work fine. Minutes later some levels start spitting out this error. I've tried making duplicates of the .json files to see if the .json file is corrupted somehow but the json file is identical. Remaking the file from scratch always fixes the problem temporarily.
I've pulled the Unity Json project from https://github.com/SaladLab/Json.Net.Unity3D and built my own .dll and .pdb files so I can look deeper into what's going on. Inside json it throws the exception basically at this line https://github.com/SaladLab/Json.Net.Unity3D/blob/master/src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs#L182. The exception has a stacktrace of this:
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0012c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x0000e] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:77 at Newtonsoft.Json.Utilities.LateBoundReflectionDelegateFactory+<>c__DisplayClass3_0.<CreateParameterizedConstructor>b__0 (System.Object[] a) [0x00003] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Utilities\\LateBoundReflectionDelegateFactory.cs:59 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonISerializableContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00197] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:1746 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00410] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:587 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0007c] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:293 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x000a6] in C:\\Users\\George\\Downloads\\Json.Net.Unity3D-master\\Json.Net.Unity3D-master\\src\\Newtonsoft.Json\\Serialization\\JsonSerializerInternalReader.cs:167
So now I'm not sure if it's because I'm using procore meshes as prefabs, prefabs with children, or json is invoking a method that doesn't exist.
I need a 3d animation editor.
Assets/GILES/Code/Editor/CreateAssetBundle.cs(34,39): error CS0619: UnityEditor.BuildPipeline.BuildAssetBundles(string, UnityEditor.BuildAssetBundleOptions)' is obsolete:
BuildAssetBundles signature has changed. Please specify the targetPlatform parameter'
https://docs.unity3d.com/540/Documentation/ScriptReference/BuildPipeline.BuildAssetBundles.html
To recreate this open up Giles and make a .cs script like this:
public class DummyInspector : MonoBehaviour { public Transform DummyTransform; }
Create a prefab that is an empty parent object with a child object. The child object must have the DummyInspector.cs component.
Drag the parent object into Resources/LevelEditorPrefabs to create a prefab. If you try to save a Giles level with this object instantiated it'll throw a UnassignedReferenceException. Full stack trace would be something like this:
UnityEngine.UnassignedReferenceException: The variable theTransform of DummyTransform has not been assigned. You probably need to assign the theTransform variable of the DummyTransform script in the inspector. at (wrapper managed-to-native) UnityEngine.Transform:get_childCount () at UnityEngine.Transform+Enumerator.MoveNext () [0x00007] in C:\buildslave\unity\build\artifacts\generated\common\runtime\TransformBindings.gen.cs:448 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter writer, IEnumerable values, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00108] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:684 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x000fe] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:179 at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary (Newtonsoft.Json.JsonWriter writer, IDictionary values, Newtonsoft.Json.Serialization.JsonDictionaryContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x00176] in C:\Users\George\Downloads\Json.Net.Unity3D-master\Json.Net.Unity3D-master\src\Newtonsoft.Json\Serialization\JsonSerializerInternalWriter.cs:1091 UnityEngine.Debug:LogError(Object) GILES.pb_Scene:SaveLevel() (at Assets/Lib Assets/GILES/Code/Scripts/pb_Scene.cs:151) GILES.pb_SaveSceneButton:Save(String) (at Assets/Lib Assets/GILES/Code/Scripts/GUI/Toolbar/pb_SaveSceneButton.cs:61) GILES.pb_SaveSceneButton:OnSave(String) (at Assets/Lib Assets/GILES/Code/Scripts/GUI/Toolbar/pb_SaveSceneButton.cs:35) GILES.Interface.pb_FileDialog:Save() (at Assets/Lib Assets/GILES/Code/Scripts/GUI/pb_FileDialog.cs:266) UnityEngine.EventSystems.EventSystem:Update()
When json is trying to serialize all the components it tries to serialize Transform/GameObject references that might be public in the inspector. Even though the values are null JSON evaluates them as not null.
Also, if you make the Child object a prefab then create a new Parent/Child prefab with the first prefab you won't get this error.
I don't know if you're aware of the following issue or not, so I thought I'd mention it.
Imagine the following hierachy:
GameObject (empty game object)
Cube (3D Object -> Cube)
The Resource Browser will not show a preview of the prefab, it will only show the name of the prefab instead.
Would it be technically possible to provide a preview of the Prefab and all of its child game objects?
In nearly all common cases it's not what the user wants.
It only makes sense for the simplest shapes. Most shapes becomes distorted. Naive users will use it without thinking and create ugly things. More thoughtful users will be constantly fighting the defaults.
I suggest the scale tool should have a non-uniform mode but the example scenes and default behaviour should be to only allow uniform scaling. Primitives where it makes sense to use non-uniform scaling (spheres, cubes and other simple shapes) should probably have a separate parameter to control their aspect ratio. (although this opens a can of worms in other areas - non-uniform cuboids have stretched textures whereas the user probably intended them to tile)
pb_HandleUtility.ObjectRaycast returns normally the closest object hit by the ray. However, when using MeshRaycast, it transfers the ray to local coordinates, and then return the "local computed distance". When using scaling, this can end up to wrong object selection. The distance must be scaled back to a common base (global coordinates, or percentage) before being compared to other distance.
Here the code to scale back to global
public static bool MeshRaycast(Mesh mesh, Ray ray, out pb_RaycastHit hit, Transform transform)
{
...
if(pb_Geometry.RayIntersectsTriangle(ray, a, b, c, Culling.Front, out dist, out point))
{
hit = new pb_RaycastHit();
hit.point = point;
hit.distance = Vector3.Distance(transform.TransformPoint(hit.point), transform.TransformPoint(ray.origin));
hit.normal = Vector3.Cross(b-a, c-a);
hit.triangle = new int[] { triangles[i], triangles[i+1], triangles[i+2] };
return true;
...
}
I think you could return distance as a percentage too, so you wouldn't need to pass the transform to the function. However it means that your ray have a certain defined length, which is usually not the case.
Hello once again
I think there are many use cases where the developer would only ever want their users to be able to select the root level editor prefab.
For example, you've created a door level prefab object which contains several child gameobjects which represents the mesh of door. In this case I wouldn't want people using the level editor to be able to move the door handle (for example). There are probably better examples out there :-P
Shaders for handle/ gizmos and grids are missing.
Hi
When i exported scene with textures, only meshes are exported, and when i omported that .json, only meshes imported and not the textures of those meshes. suggest me how to export textures also. Or is it not possible?
Thanks.
Saravanan.M
Can I use / modify Giles in my project I am developing in unity? Thanks - of course for commercial purpose.
Edit:
For example, some objects may not be designed to be rotated on a particular axis. Some objects should maybe never be allowed to scale, etc. It would be useful if a feature which allowed various parts of Transform manipulation to be disabled was developed
Does it support URP?
Hello once again
I just want to say GILES has been an absolute pleasure to use so far.
Anyway... I think developers would prefer not to display class names in the inspector. The screenshot below is an example of what would happen if I attached the 'ExampleCustomScript' component to my game object.
I don't know if the following suggestion is the best way of doing it, but I've achieved the screenshot below by defining a custom attribute.
It may also be useful to enable a similar attribute for properties and/or fields. (If you think attributes are the right way of doing it)
How I implemented the example above:
https://github.com/EitanElbaz/giles/commit/941b78df925cfd2be91ae801268e2863e7128c8d
As per the docs on this link https://github.com/Unity-Technologies/giles/blob/master/docs/docs/tutorial/quickstart.md , there must exist a publication of files on unity asset store. But I can't find anything there?
In the documentation you described that there is a method of loading through AssetBündle and left a link, but there are no examples. (https://github.com/Unity-Technologies/giles/blob/master/docs/docs/tutorial/resources.md)
Hello
I don't know if you have anything in mind for doing this, but I have a very rough (and unrefined) idea of how this may be done.
Firstly, I think it would be extremely handy and desirable to many users of GILES to be able to split level editor prefabs into different categories.
The basic models (catchier names required :-|):
Resource Browser:
Category[] categories;
Category:
string name;
LevelEditorPrefab[] prefabs;
Level Editor Prefab:
string name;
GameObject prefab;
I'm not much of a GUI designer, but to accommodate for categories and their editor prefabs, the current resource browser could contain a list of the collapsible/expandable GUI elements.
Common use case:
Let's take the original GILES preview video as an example.
Someone is making an FPS game which allows people to create their own maps. They want the following example categories to make it easier for their players to find level editor prefabs:
This categorization of level editor objects is something I'll be looking at doing for my own game, so I'd be happy to write it in a non specific way and contribute it to this project if that's something you're interested in. You'd probably want to tidy the code up if it's not up to your standards thoug
GILES seems to use some sort of GUI thing that prevents it from working with Unity 2020.1.4f1. :I
Loosely related to #8
Having "UnityEngine.Transform" displayed in the level editor inspector isn't massively pretty.
Hi,
How should I control the preview prefabs in the Resource Browser window?
1/ I add my own prefabs and I see only text in the preview
2/ I copied the stuff from the scene with the Editor to my scene - all prefab previews disappeared in the Resource browser showing different images.
how to control it?
Hello once again
GILES has been awesome to work with so far.
I have however been noticing that the sheer amount of data being generated when saving a level is absolutely enormous.
A level with 10 or so objects will often exceed 10MB of pure JSON data.
Parsing a large amount of JSON and instantiating all of the objects at once also causes quite a lag spike as you might imagine :P
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.