Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Common_glTF_Exporter/Export/Draco.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public static void Compress(Preferences preferences)
files.Add(fileToCompress);
}

#if REVIT2025 || REVIT2026
#if REVIT2025 || REVIT2026

var loadContext = new NonCollectibleAssemblyLoadContext();

string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string assemblyPath = Path.Combine(programDataPath, "Autodesk", "ApplicationPlugins", "leia.bundle", "Contents", "2025", "DracoWrapper.dll");

Assembly mixedModeAssembly = loadContext.LoadFromAssemblyPath(assemblyPath);
Expand Down
4 changes: 2 additions & 2 deletions Common_glTF_Exporter/Export/MeshOpt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public static void Compress(Preferences preferences)
files.Add(fileToCompress);
}

#if REVIT2025 || REVIT2026
#if REVIT2025 || REVIT2026

var loadContext = new NonCollectibleAssemblyLoadContext();

string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string meshOptPath = Path.Combine(programDataPath, "Autodesk", "ApplicationPlugins", "leia.bundle", "Contents", "2025", "MeshOpt.dll");
Assembly mixedModeAssembly = loadContext.LoadFromAssemblyPath(meshOptPath);
MethodInfo defaultSettings = mixedModeAssembly.GetType("Gltf.GltfSettings").GetMethod("defaults");
Expand Down
27 changes: 18 additions & 9 deletions Common_glTF_Exporter/Utils/RevitIniReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,26 @@ public static List<string> GetAdditionalRenderAppearancePaths()

foreach (var p in paths)
{
string trimmedPath = p.Trim();
string cleanedPath = p.Trim().Trim('"');

// If already rooted, normalize it
if (Path.IsPathRooted(trimmedPath))
{
absolutePaths.Add(Path.GetFullPath(trimmedPath));
}
else
// Replace | with ; or split further if needed
cleanedPath = cleanedPath.Replace('|', ';');

foreach (var subPath in cleanedPath.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
{
// Combine with user profile to resolve relative path
string fullPath = Path.GetFullPath(Path.Combine(userProfile, trimmedPath));
string trimmedPath = subPath.Trim().Trim('"');

if (Path.GetInvalidPathChars().Any(c => trimmedPath.Contains(c)))
{
// Skip or log invalid path
Console.WriteLine($"Skipping invalid path: {trimmedPath}");
continue;
}

string fullPath = Path.IsPathRooted(trimmedPath)
? Path.GetFullPath(trimmedPath)
: Path.GetFullPath(Path.Combine(userProfile, trimmedPath));

absolutePaths.Add(fullPath);
}
}
Expand Down
9 changes: 6 additions & 3 deletions Common_glTF_Exporter/Utils/glTFExportUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,12 @@ public static void AddNormals(Transform transform, PolymeshTopology polymesh, Li
{
var newNormal = transform.OfVector(normal).Normalize();

normals.Add(newNormal.X);
normals.Add(newNormal.Y);
normals.Add(newNormal.Z);
for (int j = 0; j < 3; j++)
{
normals.Add(newNormal.X);
normals.Add(newNormal.Y);
normals.Add(newNormal.Z);
}
}

break;
Expand Down
4 changes: 3 additions & 1 deletion Common_glTF_Exporter/Windows/ErrorWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
</TextBlock>

<StackPanel Orientation="Horizontal"
VerticalAlignment="Bottom">
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Margin="0,0,0,15">
<Button Content="Report Error"
Style="{DynamicResource MainButtonStyle}"
Background="Transparent"
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ If you're interested in contributing to glTF exporter, just submit a [pull reque
## Installation
Looking to get the revit-glTF-exporter add-in? Check out [Autodesk app store](https://apps.autodesk.com/RVT/es/Detail/Index?id=492952120634946986&appLang=en&os=Win64).

## Sponsors ##
Thanks to all the sponsors that have helped us improve Leia. If you want to be one let us know!

[<img src="https://s3.us-east-1.amazonaws.com/everse.assets/GithubReadme/Visiofy.png">](https://www.visiofy.com/)

## About us ##

We are an international mix of AEC professionals, product designers, and software developers. We work together to transform construction requirements into accurate and partnership-driven technological solutions.
Expand Down
Loading