Fixed a critical bug in Array field name generation. Added DNAAttribute and DNAListAttribute classes
This commit is contained in:
40
BlendFile/DNAAttribute.cs
Normal file
40
BlendFile/DNAAttribute.cs
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BlendFile {
|
||||||
|
|
||||||
|
[AttributeUsageAttribute(AttributeTargets.All)]
|
||||||
|
public class DNAAttribute : System.Attribute {
|
||||||
|
private int _OriginalIndex;
|
||||||
|
public virtual int OriginalIndex {
|
||||||
|
get {
|
||||||
|
return this._OriginalIndex;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._OriginalIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _OriginalName;
|
||||||
|
public virtual string OriginalName {
|
||||||
|
get {
|
||||||
|
return this._OriginalName;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._OriginalName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DNAAttribute(int OriginalIndex, string OriginalName) {
|
||||||
|
this._OriginalIndex = OriginalIndex;
|
||||||
|
this._OriginalName = OriginalName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
100
BlendFile/DNAListAttribute.cs
Normal file
100
BlendFile/DNAListAttribute.cs
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
namespace BlendFile {
|
||||||
|
|
||||||
|
[AttributeUsageAttribute(AttributeTargets.Property | AttributeTargets.Field)]
|
||||||
|
public class DNAListAttribute : System.Attribute {
|
||||||
|
private int _Size;
|
||||||
|
public virtual int Size {
|
||||||
|
get {
|
||||||
|
return this._Size;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._Size = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _OriginalType;
|
||||||
|
public virtual string OriginalType {
|
||||||
|
get {
|
||||||
|
return this._OriginalType;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._OriginalType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _OriginalName;
|
||||||
|
public virtual string OriginalName {
|
||||||
|
get {
|
||||||
|
return this._OriginalName;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._OriginalName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _OriginalIndex;
|
||||||
|
public virtual int OriginalIndex {
|
||||||
|
get {
|
||||||
|
return this._OriginalIndex;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._OriginalIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _UnderlyingType;
|
||||||
|
public virtual string UnderlyingType {
|
||||||
|
get {
|
||||||
|
return this._UnderlyingType;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._UnderlyingType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _CountFieldName;
|
||||||
|
public virtual string CountFieldName {
|
||||||
|
get {
|
||||||
|
return this._CountFieldName;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._CountFieldName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _CountFieldIndex;
|
||||||
|
public virtual int CountFieldIndex {
|
||||||
|
get {
|
||||||
|
return this._CountFieldIndex;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._CountFieldIndex = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _MemoryOffset;
|
||||||
|
public virtual int MemoryOffset {
|
||||||
|
get {
|
||||||
|
return this._MemoryOffset;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this._MemoryOffset = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public DNAListAttribute(int Size, string OriginalType, string OriginalName, int OriginalIndex, string UnderlyingType, string CountFieldName, int CountFieldIndex, int MemoryOffset) {
|
||||||
|
this._Size = Size;
|
||||||
|
this._OriginalType = OriginalType;
|
||||||
|
this._OriginalName = OriginalName;
|
||||||
|
this._OriginalIndex = OriginalIndex;
|
||||||
|
this._UnderlyingType = UnderlyingType;
|
||||||
|
this._CountFieldName = CountFieldName;
|
||||||
|
this._CountFieldIndex = CountFieldIndex;
|
||||||
|
this._MemoryOffset = MemoryOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArgumentException_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F0beb96d31db641cf82014cb1a758a330b2dc00_003Fea_003F056794d0_003FArgumentException_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArgumentException_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F0beb96d31db641cf82014cb1a758a330b2dc00_003Fea_003F056794d0_003FArgumentException_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArgumentOutOfRangeException_002Ecs_002Fl_003AC_0021_003FUsers_003Fairon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F72e5853ed6f2c1967eff9d6f0cf6ba12744c8978c516cbc5e74d992944ab_003FArgumentOutOfRangeException_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_002ECoreCLR_002Ecs_002Fl_003AC_0021_003FUsers_003Fairon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fee3c9d264411441f56a12bac52a58ad25b495ef52e59b4a86f8478158f7d_003FArray_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_002ECoreCLR_002Ecs_002Fl_003AC_0021_003FUsers_003Fairon_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fee3c9d264411441f56a12bac52a58ad25b495ef52e59b4a86f8478158f7d_003FArray_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F51b332f64116ca1bf68931ca13adc3cd38b6dd2da04af6aef46bd08d218e58b5_003FArray_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArray_002ECoreCLR_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F51b332f64116ca1bf68931ca13adc3cd38b6dd2da04af6aef46bd08d218e58b5_003FArray_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACodeDomProvider_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4333c036d67eaa64623a27221cb821b663bc08410ac68797b1c10376d8379fe_003FCodeDomProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACodeDomProvider_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F4333c036d67eaa64623a27221cb821b663bc08410ac68797b1c10376d8379fe_003FCodeDomProvider_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ namespace CodeGenerator {
|
|||||||
var dimensions = GetArrayDimensions(name);
|
var dimensions = GetArrayDimensions(name);
|
||||||
|
|
||||||
// Get clean field name (without array brackets)
|
// Get clean field name (without array brackets)
|
||||||
name = field.Name.ParseFName().Substring(0, field.Name.IndexOf('['));
|
name = field.Name.Substring(0, field.Name.IndexOf('[')).ParseFName();
|
||||||
|
|
||||||
//Check if the type is a built-in type or a custom type
|
//Check if the type is a built-in type or a custom type
|
||||||
if (t != null) cmf = new(t, name); //Built-in type
|
if (t != null) cmf = new(t, name); //Built-in type
|
||||||
|
|||||||
Reference in New Issue
Block a user