Merge pull request #111 from specklesystems/dev

* 2.18 Update

* fixed bug with selection not correctly restoring after deserializing

* Bump core to 2.18.0-rc

* FE2 terms (#112)

* FE2 terms

* SendComponent

* Removed terminology switching

* Bumped core version (#113)
This commit is contained in:
Jedd Morgan 2024-03-14 10:53:50 +00:00 коммит произвёл GitHub
Родитель edeec70993 790e5d8294
Коммит 5359731dce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
28 изменённых файлов: 1170 добавлений и 730 удалений

Просмотреть файл

@ -23,7 +23,7 @@ public class AttachSpecklePropertiesExample : MonoBehaviour
public virtual void Start()
{
Client speckleClient = new(AccountManager.GetDefaultAccount());
Client speckleClient = new(AccountManager.GetDefaultAccount()!);
StartCoroutine(AttachSpeckleProperties(speckleClient, streamId, objectId));
}

Просмотреть файл

@ -1,10 +1,10 @@
using System;
using System.Collections;
using System.Threading.Tasks;
using Speckle.ConnectorUnity;
using Speckle.ConnectorUnity.Components;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Models;
using Speckle.Core.Transports;
using UnityEngine;
@ -12,60 +12,56 @@ using UnityEngine;
[RequireComponent(typeof(RecursiveConverter))]
public class ManualReceive : MonoBehaviour
{
public string authToken;
public string serverUrl;
public string streamId, objectId;
private RecursiveConverter receiver;
public string streamId,
objectId;
private RecursiveConverter receiver;
void Awake()
{
receiver = GetComponent<RecursiveConverter>();
}
IEnumerator Start()
{
Debug.developerConsoleVisible = true;
if(Time.timeSinceLevelLoad > 20) yield return null;
if (Time.timeSinceLevelLoad > 20)
yield return null;
Receive();
}
[ContextMenu(nameof(Receive))]
public void Receive()
{
var account = new Account()
{
token = authToken,
serverInfo = new ServerInfo() {url = serverUrl},
serverInfo = new ServerInfo() { url = serverUrl },
};
Task.Run(async () =>
{
var transport = new ServerTransport(account, streamId);
var localTransport = new MemoryTransport();
var @base = await Operations.Receive(
using ServerTransport transport = new(account, streamId);
MemoryTransport localTransport = new();
Base speckleObject = await Operations.Receive(
objectId,
remoteTransport: transport,
localTransport: localTransport,
onErrorAction: (m, e) => Debug.LogError(m + e),
disposeTransports: true
localTransport: localTransport
);
if (@base == null) throw new Exception("received data was null!");
Dispatcher.Instance().Enqueue(() =>
{
var parentObject = new GameObject(name);
receiver.RecursivelyConvertToNative_Sync(@base, parentObject.transform);
Debug.Log($"Receive {objectId} completed");
});
Dispatcher
.Instance()
.Enqueue(() =>
{
var parentObject = new GameObject(name);
receiver.RecursivelyConvertToNative_Sync(speckleObject, parentObject.transform);
Debug.Log($"Receive {objectId} completed");
});
});
}
}

Просмотреть файл

@ -2,6 +2,7 @@ using System.Threading;
using System.Threading.Tasks;
using Speckle.ConnectorUnity.Components;
using Speckle.Core.Api;
using Speckle.Core.Credentials;
using Speckle.Core.Models;
using Speckle.Core.Transports;
using UnityEngine;
@ -18,24 +19,25 @@ namespace Extra
{
[Range(0, 100)]
public int numberOfIterations = 10;
public Vector3 translation = Vector3.forward * 100;
public GameObject objectToSend;
private SpeckleSender sender;
private void Awake()
{
sender = GetComponent<SpeckleSender>();
}
public async Task SendIterations()
{
GameObject go = new GameObject();
for (int i = 0; i < numberOfIterations; i++)
{
Instantiate(objectToSend, translation * i, Quaternion.identity, go.transform);
Base b = sender.Converter.RecursivelyConvertToSpeckle(go, _ => true);
await Send(b, $"{i}");
}
@ -44,20 +46,23 @@ namespace Extra
private async Task<string> Send(Base data, string branchName)
{
var client = sender.Account.Client;
var stream = sender.Stream.Selected;
ServerTransport transport = new ServerTransport(sender.Account.Selected, stream!.id);
await client.BranchCreate(new BranchCreateInput(){streamId = stream.id, name = branchName});
return await SpeckleSender.SendDataAsync(CancellationToken.None,
Client client = sender.Account.Client!;
Stream stream = sender.Stream.Selected;
Account selectedAccount = sender.Account.Selected!;
using ServerTransport transport = new(selectedAccount, stream!.id);
string branchId = await client.BranchCreate(
new BranchCreateInput() { streamId = stream.id, name = branchName }
);
return await SpeckleSender.SendDataAsync(
remoteTransport: transport,
data: data,
client: client!,
branchName: branchName,
createCommit: true,
onProgressAction: null,
onErrorAction: (m, e) => throw e);
data,
client,
branchId,
true
);
}
}
@ -68,7 +73,7 @@ namespace Extra
public override async void OnInspectorGUI()
{
DrawDefaultInspector();
if (GUILayout.Button("Create and send"))
{
await ((PerformanceTestSender)target).SendIterations();

Просмотреть файл

@ -3,7 +3,6 @@ using System.Collections.Generic;
using UnityEngine;
using Speckle.Core.Credentials;
using System.Linq;
using UnityEngine.Events;
using UnityEngine.UI;
using Stream = Speckle.Core.Api.Stream;

Просмотреть файл

@ -1,14 +1,14 @@
{
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.collab-proxy": "2.0.5",
"com.unity.collab-proxy": "2.0.7",
"com.unity.ide.rider": "3.0.24",
"com.unity.ide.visualstudio": "2.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.5",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.2",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.4",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

Просмотреть файл

@ -7,7 +7,7 @@
"dependencies": {}
},
"com.unity.collab-proxy": {
"version": "2.0.5",
"version": "2.0.7",
"depth": 0,
"source": "registry",
"dependencies": {},
@ -94,12 +94,12 @@
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.2",
"version": "2.0.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.3",
"com.unity.sysroot.linux-x86_64": "2.0.2"
"com.unity.sysroot": "2.0.5",
"com.unity.sysroot.linux-x86_64": "2.0.4"
},
"url": "https://packages.unity.com"
},

Просмотреть файл

@ -1,4 +1,3 @@
#nullable enable
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
@ -13,6 +12,12 @@ namespace Speckle.ConnectorUnity.Components.Editor
[CustomEditor(typeof(SpeckleReceiver))]
public class SpeckleReceiverEditor : UnityEditor.Editor
{
private SerializedProperty _accountSelection;
private SerializedProperty _streamSelection;
private SerializedProperty _branchSelection;
private SerializedProperty _commitSelection;
#nullable enable
private static bool _generateAssets;
private bool _foldOutStatus = true;
private Texture2D? _previewImage;
@ -21,7 +26,11 @@ namespace Speckle.ConnectorUnity.Components.Editor
{
var speckleReceiver = (SpeckleReceiver)target;
DrawDefaultInspector();
//Selection
EditorGUILayout.PropertyField(_accountSelection);
EditorGUILayout.PropertyField(_streamSelection, new GUIContent("Project"));
EditorGUILayout.PropertyField(_branchSelection, new GUIContent("Model"));
EditorGUILayout.PropertyField(_commitSelection, new GUIContent("Version"));
//Preview image
{
@ -64,8 +73,8 @@ namespace Speckle.ConnectorUnity.Components.Editor
else if (userRequestedReceive)
{
var id = Progress.Start(
"Receiving Speckle data",
"Fetching commit data",
"Receiving Speckle Model",
"Fetching data from Speckle",
Progress.Options.Sticky
);
Progress.ShowDetails();
@ -96,6 +105,19 @@ namespace Speckle.ConnectorUnity.Components.Editor
public void OnEnable()
{
Init();
_accountSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleReceiver.Account)}>k__BackingField"
);
_streamSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleReceiver.Stream)}>k__BackingField"
);
_branchSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleReceiver.Branch)}>k__BackingField"
);
_commitSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleReceiver.Commit)}>k__BackingField"
);
}
public void Reset()
@ -163,7 +185,7 @@ namespace Speckle.ConnectorUnity.Components.Editor
bool BeforeConvert(TraversalContext context)
{
Base b = context.current;
Base b = context.Current;
//NOTE: progress wont reach 100% because not all objects are convertable
float progress = (childrenConverted + childrenFailed) / totalChildrenFloat;

Просмотреть файл

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
@ -9,7 +10,6 @@ using UnityEngine;
using UnityEngine.SceneManagement;
using Component = UnityEngine.Component;
#nullable enable
namespace Speckle.ConnectorUnity.Components.Editor
{
public enum SelectionFilter
@ -35,12 +35,32 @@ namespace Speckle.ConnectorUnity.Components.Editor
[CanEditMultipleObjects]
public class SpeckleSendEditor : UnityEditor.Editor
{
private SerializedProperty _accountSelection;
private SerializedProperty _streamSelection;
private SerializedProperty _branchSelection;
#nullable enable
private SelectionFilter _selectedFilter = SelectionFilter.Children;
public void OnEnable()
{
_accountSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleSender.Account)}>k__BackingField"
);
_streamSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleSender.Stream)}>k__BackingField"
);
_branchSelection = serializedObject.FindProperty(
$"<{nameof(SpeckleSender.Branch)}>k__BackingField"
);
}
public override async void OnInspectorGUI()
{
//Draw events in a collapsed region
DrawDefaultInspector();
//Selection
EditorGUILayout.PropertyField(_accountSelection);
EditorGUILayout.PropertyField(_streamSelection, new GUIContent("Project"));
EditorGUILayout.PropertyField(_branchSelection, new GUIContent("Model"));
bool shouldSend = GUILayout.Button("Send!");
_selectedFilter = (SelectionFilter)
@ -77,10 +97,9 @@ namespace Speckle.ConnectorUnity.Components.Editor
),
};
//TODO onError action?
if (data["@objects"] is IList l && l.Count == 0)
{
Debug.LogWarning($"Nothing to send", speckleSender);
Debug.LogWarning("Nothing to send", speckleSender);
return null;
}

Просмотреть файл

@ -46,7 +46,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection.Editor
details = new (string, Func<Stream, string>)[]
{
("Stream id", s => s.id),
("Project id", s => s.id),
("Description", s => s.description),
("Is Public", s => s.isPublic.ToString()),
("Role", s => s.role),
@ -88,7 +88,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection.Editor
{
details = new (string, Func<Commit, string>)[]
{
("Commit Id", s => s.id),
("Version Id", s => s.id),
("Author Name", s => s.authorName),
("Created At", s => s.createdAt.ToString(CultureInfo.InvariantCulture)),
("Source Application", s => s.sourceApplication),

Просмотреть файл

@ -64,7 +64,7 @@ namespace Speckle.ConnectorUnity
cancellationTokenSource = new CancellationTokenSource();
var client = new Client(account ?? AccountManager.GetDefaultAccount());
var client = new Client(account ?? AccountManager.GetDefaultAccount()!);
transport = new ServerTransport(client.Account, streamId);
transport.CancellationToken = cancellationTokenSource.Token;

Просмотреть файл

@ -49,7 +49,8 @@ namespace Speckle.ConnectorUnity.Components
);
var accountTask = new Utils.Utils.WaitForTask<Account>(
async () => await GetAccount(sw)
async () => await GetAccount(sw),
_tokenSource.Token
);
yield return accountTask;
@ -57,8 +58,10 @@ namespace Speckle.ConnectorUnity.Components
using Client c = new(accountTask.Result);
var objectIdTask = new Utils.Utils.WaitForTask<(string, Commit?)>(
async () => await GetObjectID(sw, c)
async () => await GetObjectID(sw, c),
_tokenSource.Token
);
yield return objectIdTask;
(string objectId, Commit? commit) = objectIdTask.Result;
@ -72,7 +75,8 @@ namespace Speckle.ConnectorUnity.Components
objectId,
commit,
cancellationToken: _tokenSource.Token
)
),
_tokenSource.Token
);
yield return receiveTask;

Просмотреть файл

@ -92,7 +92,7 @@ namespace Speckle.ConnectorUnity.Components
public bool WasSuccessful() => this.exception == null;
public Base SpeckleObject => traversalContext.current;
public Base SpeckleObject => traversalContext.Current;
}
public partial class RecursiveConverter
@ -143,7 +143,7 @@ namespace Speckle.ConnectorUnity.Components
var objectsToConvert = traversalFunc
.Traverse(rootObject)
.Where(x => ConverterInstance.CanConvertToNative(x.current))
.Where(x => ConverterInstance.CanConvertToNative(x.Current))
.Where(x => userPredicate(x));
Dictionary<Base, GameObject?> created = new();
@ -186,9 +186,9 @@ namespace Speckle.ConnectorUnity.Components
{
Transform? currentParent = GetParent(tc, outCreatedObjects) ?? parent;
var converted = ConvertToNative(tc.current, currentParent);
var converted = ConvertToNative(tc.Current, currentParent);
result = new ConversionResult(tc, converted);
outCreatedObjects.TryAdd(tc.current, result.converted);
outCreatedObjects.TryAdd(tc.Current, result.converted);
}
catch (Exception ex)
{
@ -209,11 +209,11 @@ namespace Speckle.ConnectorUnity.Components
if (tc == null)
return null; //We've reached the root object, and still not found a converted parent
if (createdObjects.TryGetValue(tc.current, out GameObject? p) && p != null)
if (createdObjects.TryGetValue(tc.Current, out GameObject? p) && p != null)
return p.transform;
//Go one level up, and repeat!
return GetParent(tc.parent, createdObjects);
return GetParent(tc.Parent, createdObjects);
}
protected GameObject ConvertToNative(Base speckleObject, Transform? parentTransform)
@ -327,7 +327,18 @@ namespace Speckle.ConnectorUnity.Components
{
object? converted = null;
if (predicate(baseObject))
converted = ConverterInstance.ConvertToNative(baseObject);
{
try
{
converted = ConverterInstance.ConvertToNative(baseObject);
}
catch (Exception ex) when (!ex.IsFatal())
{
Debug.LogWarning(
$"Failed to convert {baseObject.speckle_type} - {baseObject.id}\n{ex}"
);
}
}
// Handle new GameObjects
Transform? nextParent = parent;

Просмотреть файл

@ -200,15 +200,15 @@ namespace Speckle.ConnectorUnity.Components
{
Client? selectedClient = Account.Client;
client =
selectedClient ?? throw new InvalidOperationException("Invalid account selection");
selectedClient ?? throw new InvalidOperationException("Invalid Speckle account selection");
Stream? selectedStream = Stream.Selected;
stream =
selectedStream ?? throw new InvalidOperationException("Invalid stream selection");
selectedStream ?? throw new InvalidOperationException("Invalid Speckle project selection");
Commit? selectedCommit = Commit.Selected;
commit =
selectedCommit ?? throw new InvalidOperationException("Invalid commit selection");
selectedCommit ?? throw new InvalidOperationException("Invalid Speckle version selection");
}
/// <summary>
@ -259,42 +259,20 @@ namespace Speckle.ConnectorUnity.Components
CancellationToken cancellationToken = default
)
{
using var transport = new ServerTransportV2(client.Account, streamId);
using var transport = new ServerTransport(client.Account, streamId);
transport.CancellationToken = cancellationToken;
cancellationToken.ThrowIfCancellationRequested();
Base? requestedObject = await Operations
Base requestedObject = await Operations
.Receive(
objectId: objectId,
cancellationToken: cancellationToken,
remoteTransport: transport,
onProgressAction: onProgressAction,
onErrorAction: (s, ex) =>
{
//Don't wrap cancellation exceptions!
if (ex is OperationCanceledException)
throw ex;
//HACK: Sometimes, the task was cancelled, and Operations.Receive doesn't fail in a reliable way. In this case, the exception is often simply a symptom of a cancel.
if (cancellationToken.IsCancellationRequested)
{
SpeckleLog.Logger.Warning(
ex,
"A task was cancelled, ignoring potentially symptomatic exception"
);
cancellationToken.ThrowIfCancellationRequested();
}
//Treat all operation errors as fatal
throw new SpeckleException(
$"Failed to receive requested object {objectId} from server: {s}",
ex
);
},
onTotalChildrenCountKnown: onTotalChildrenCountKnown,
disposeTransports: false
objectId,
transport,
null,
onProgressAction,
onTotalChildrenCountKnown,
cancellationToken
)
.ConfigureAwait(false);
@ -317,9 +295,6 @@ namespace Speckle.ConnectorUnity.Components
}
);
if (requestedObject == null)
throw new SpeckleException($"Operation {nameof(Operations.Receive)} returned null");
cancellationToken.ThrowIfCancellationRequested();
//Read receipt
@ -340,10 +315,10 @@ namespace Speckle.ConnectorUnity.Components
)
.ConfigureAwait(false);
}
catch (Exception e)
catch (Exception ex)
{
// Do nothing!
Debug.LogWarning($"Failed to send read receipt\n{e}");
Debug.LogWarning($"Failed to send read receipt\n{ex}");
}
return requestedObject;
@ -447,12 +422,9 @@ namespace Speckle.ConnectorUnity.Components
/// <summary>
/// Fetches the commit preview for the currently selected commit
/// </summary>
/// <param name="allAngles">when <see langword="true"/>, will fetch 360 degree preview image</param>
/// <param name="callback">Callback function to be called when the web request completes</param>
/// <returns>The executing <see cref="Coroutine"/> or <see langword="null"/> if <see cref="Account"/>, <see cref="Stream"/>, or <see cref="Commit"/> was <see langword="null"/></returns>
public Coroutine? GetPreviewImage( /*bool allAngles,*/
Action<Texture2D?> callback
)
public Coroutine? GetPreviewImage(Action<Texture2D?> callback)
{
Account? account = Account.Selected;
if (account == null)
@ -473,28 +445,28 @@ namespace Speckle.ConnectorUnity.Components
}
#if UNITY_EDITOR
[ContextMenu("Open Speckle Stream in Browser")]
[ContextMenu("Open Speckle Model in Browser")]
protected void OpenUrlInBrowser()
{
string url = GetSelectedUrl();
Application.OpenURL(url);
Uri url = GetSelectedUrl();
Application.OpenURL(url.ToString());
}
#endif
public string GetSelectedUrl()
public Uri GetSelectedUrl()
{
string serverUrl = Account.Selected!.serverInfo.url;
string? streamId = Stream.Selected?.id;
string? branchName = Branch.Selected?.name;
string? commitId = Commit.Selected?.id;
Account selectedAccount = Account.Selected!;
StreamWrapper sw =
new()
{
ServerUrl = selectedAccount.serverInfo.url,
StreamId = Stream.Selected!.id,
BranchName = Branch.Selected?.id,
CommitId = Commit.Selected?.id
};
sw.SetAccount(selectedAccount);
if (string.IsNullOrEmpty(streamId))
return serverUrl;
if (!string.IsNullOrEmpty(commitId))
return $"{serverUrl}/streams/{streamId}/commits/{commitId}";
if (!string.IsNullOrEmpty(branchName))
return $"{serverUrl}/streams/{streamId}/branches/{branchName}";
return $"{serverUrl}/streams/{streamId}";
return sw.ToServerUri();
}
public void Awake()

Просмотреть файл

@ -36,6 +36,7 @@ namespace Speckle.ConnectorUnity.Components
[HideInInspector]
public BranchSelectionEvent OnBranchSelectionChange;
[Obsolete("No longer used")]
[HideInInspector]
public ErrorActionEvent OnErrorAction;
@ -61,40 +62,44 @@ namespace Speckle.ConnectorUnity.Components
)
throw new SpeckleException(error);
ServerTransport transport = new ServerTransport(client.Account, stream.id);
using ServerTransport transport = new(client.Account, stream.id);
transport.CancellationToken = CancellationTokenSource.Token;
return await SendDataAsync(
CancellationTokenSource.Token,
remoteTransport: transport,
data: data,
client: client,
branchName: branch.name,
createCommit: createCommit,
onProgressAction: dict => OnSendProgressAction.Invoke(dict),
onErrorAction: (m, e) => OnErrorAction.Invoke(m, e)
data,
client,
branch.id,
createCommit,
dict => OnSendProgressAction.Invoke(dict),
CancellationTokenSource.Token
);
}
/// <param name="remoteTransport">The transport to send to</param>
/// <param name="data">The data to send</param>
/// <param name="client">An authenticated Speckle Client</param>
/// <param name="branchId">The branch name or id</param>
/// <param name="createCommit">when <see langword="true"/> will call <see cref="Client.CommitCreate"/>, otherwise only the object data is sent</param>
/// <param name="onProgressAction">Called every progress tick of the <see cref="Operations.Send"/></param>
/// <param name="cancellationToken">Optional cancellation token</param>
/// <returns>The id (hash) of the object sent</returns>
public static async Task<string> SendDataAsync(
CancellationToken cancellationToken,
ServerTransport remoteTransport,
Base data,
Client client,
string branchName,
string branchId,
bool createCommit,
Action<ConcurrentDictionary<string, int>>? onProgressAction = null,
Action<string, Exception>? onErrorAction = null
CancellationToken cancellationToken = default
)
{
string res = await Operations.Send(
data,
cancellationToken: cancellationToken,
new List<ITransport> { remoteTransport },
useDefaultCache: true,
disposeTransports: true,
onProgressAction: onProgressAction,
onErrorAction: onErrorAction
remoteTransport,
true,
onProgressAction,
cancellationToken
);
Analytics.TrackEvent(
@ -115,15 +120,26 @@ namespace Speckle.ConnectorUnity.Components
string commitMessage = $"Sent {data.totalChildrenCount} objects from {unityVer}";
string commitId = await CreateCommit(
cancellationToken,
data,
client,
streamId,
branchName,
branchId,
res,
commitMessage
commitMessage,
cancellationToken
);
string url = $"{client.ServerUrl}/streams/{streamId}/commits/{commitId}";
StreamWrapper sw =
new()
{
ServerUrl = client.ServerUrl,
StreamId = streamId,
BranchName = branchId,
CommitId = commitId,
};
sw.SetAccount(client.Account);
string url = sw.ToServerUri().GetLeftPart(UriPartial.Path);
Debug.Log($"Data successfully sent to <a href=\"{url}\">{url}</a>");
}
@ -131,13 +147,13 @@ namespace Speckle.ConnectorUnity.Components
}
public static async Task<string> CreateCommit(
CancellationToken cancellationToken,
Base data,
Client client,
string streamId,
string branchName,
string objectId,
string message
string message,
CancellationToken cancellationToken
)
{
string commitId = await client.CommitCreate(
@ -249,5 +265,28 @@ namespace Speckle.ConnectorUnity.Components
{
Initialise();
}
[Obsolete("use other overload")]
public static async Task<string> SendDataAsync(
CancellationToken cancellationToken,
ServerTransport remoteTransport,
Base data,
Client client,
string branchName,
bool createCommit,
Action<ConcurrentDictionary<string, int>>? onProgressAction = null,
Action<string, Exception>? onErrorAction = null
)
{
return await SendDataAsync(
remoteTransport,
data,
client,
branchName,
createCommit,
onProgressAction,
cancellationToken
);
}
}
}

Просмотреть файл

@ -10,9 +10,7 @@ using UnityEngine.Rendering;
using Material = UnityEngine.Material;
using Mesh = UnityEngine.Mesh;
using SMesh = Objects.Geometry.Mesh;
using SColor = System.Drawing.Color;
using Transform = UnityEngine.Transform;
using STransform = Objects.Other.Transform;
#nullable enable
namespace Objects.Converter.Unity

Просмотреть файл

@ -8,7 +8,6 @@ using UnityEngine;
using Material = UnityEngine.Material;
using SMesh = Objects.Geometry.Mesh;
using SColor = System.Drawing.Color;
using STransform = Objects.Other.Transform;
namespace Objects.Converter.Unity
{
@ -76,7 +75,7 @@ namespace Objects.Converter.Unity
// 3. Otherwise, convert fresh!
string name = CoreUtils.GenerateObjectName(renderMaterial);
Color diffuse = renderMaterial.diffuse.ToUnityColor();
bool isOpaque = Math.Abs(renderMaterial.opacity - 1d) < Constants.Eps;
bool isOpaque = Math.Abs(renderMaterial.opacity - 1d) < Constants.EPS;
Color color = new(diffuse.r, diffuse.g, diffuse.b, (float)renderMaterial.opacity);
float metalic = (float)renderMaterial.metalness;
float gloss = 1f - (float)renderMaterial.roughness;

Двоичный файл не отображается.

Двоичный файл не отображается.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -98,7 +98,7 @@ namespace Speckle.ConnectorUnity
yield return null;
}
private static Dispatcher _instance = null;
private static Dispatcher _instance;
public static bool Exists()
{

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -14,6 +14,32 @@
Station equation direction for the corresponding station equation should be true for increasing or false for decreasing
</summary>
</member>
<member name="M:Objects.BuiltElements.Archicad.ComponentProperties.ToBase(System.Collections.Generic.List{Objects.BuiltElements.Archicad.ComponentProperties})">
<summary>
Turns a List of ComponentProperties into a Base so that it can be used with the Speckle properties prop
</summary>
<param name="componentPropertiesList"></param>
<returns></returns>
</member>
<member name="M:Objects.BuiltElements.Archicad.Property.ToBase(System.Collections.Generic.List{Objects.BuiltElements.Archicad.Property})">
<summary>
Turns a List of Property into a Base so that it can be used with the Speckle properties prop
</summary>
<param name="properties"></param>
<returns></returns>
</member>
<member name="M:Objects.BuiltElements.Archicad.PropertyGroup.ToBase(System.Collections.Generic.List{Objects.BuiltElements.Archicad.PropertyGroup})">
<summary>
Turns a List of PropertyGroup into a Base so that it can be used with the Speckle properties prop
</summary>
<param name="propertyGroups"></param>
<returns></returns>
</member>
<member name="M:Objects.BuiltElements.Area.#ctor(System.String,System.String,Objects.BuiltElements.Level,Objects.Geometry.Point)">
<summary>
SchemaBuilder constructor for an Area
</summary>
</member>
<member name="P:Objects.BuiltElements.Civil.CivilAlignment.parent">
<summary>
Name of parent alignment if this is an offset alignment
@ -29,250 +55,6 @@
Name of parent profile if this is an offset profile
</summary>
</member>
<member name="M:Objects.BuiltElements.Area.#ctor(System.String,System.String,Objects.BuiltElements.Level,Objects.Geometry.Point)">
<summary>
SchemaBuilder constructor for a Room
</summary>
<remarks>Assign units when using this constructor due to <paramref name="height"/> param</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitColumn.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Double,System.Double,System.Boolean,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit column
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="topLevel"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="structural"></param>
<param name="rotation"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="baseOffset"/> and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitDuct.#ctor(System.String,System.String,Objects.Geometry.Line,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit duct (deprecated)
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitDuct.#ctor(System.String,System.String,Objects.ICurve,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit duct
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseCurve"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitFlexDuct.#ctor(System.String,System.String,Objects.ICurve,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,Objects.Geometry.Vector,Objects.Geometry.Vector,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit flex duct
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseCurve"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitLevel.#ctor(System.String,System.Double,System.Boolean,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit level
</summary>
<param name="name"></param>
<param name="elevation"></param>
<param name="createView"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="elevation"/> param</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkElement.isCurveBased">
<summary>
Indicates if this element was constructed from an MEP curve
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkElement.isConnectorBased">
<summary>
Indicates if this element needs temporary placeholder objects to be created first when receiving
</summary>
<remarks>
For example, some fittings cannot be created based on connectors, and so will be created similarly to mechanical equipment
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.systemName">
<summary>
The system category
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.shape">
<summary>
The connector profile shape of the <see cref="T:Objects.BuiltElements.NetworkLink"/>
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.domain">
<summary>
The link domain
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.fittingIndex">
<summary>
The index indicating the position of this link on the connected fitting element, if applicable
</summary>
<remarks>
Revit fitting links are 1-indexed. For example, "T" fittings will have ordered links from index 1-3.
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.needsPlaceholders">
<summary>
Indicates if this link needs temporary placeholder objects to be created first when receiving
</summary>
<remarks>
Placeholder geometry are curves.
For example, U-bend links need temporary pipes to be created first, if one or more linked pipes have not yet been created in the network.
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.isConnected">
<summary>
Indicates if this link has been connected to its elements
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitShaft.#ctor(Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit shaft
</summary>
<param name="outline"></param>
<param name="bottomLevel"></param>
<param name="topLevel"></param>
<param name="parameters"></param>
</member>
<member name="M:Objects.BuiltElements.Revit.DirectShape.#ctor(System.String,Objects.BuiltElements.Revit.RevitCategory,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
Constructs a new <see cref="T:Objects.BuiltElements.Revit.DirectShape"/> instance given a list of <see cref="T:Speckle.Core.Models.Base"/> objects.
</summary>
<param name="name">The name of the <see cref="T:Objects.BuiltElements.Revit.DirectShape"/></param>
<param name="category">The <see cref="T:Objects.BuiltElements.Revit.RevitCategory"/> of this instance.</param>
<param name="baseGeometries">A list of base classes to represent the direct shape (only mesh and brep are allowed, anything else will be ignored.)</param>
<param name="parameters">Optional Parameters for this instance.</param>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitFamilyCategory">
<summary>
FamilyDocuments can only be assigned these categories
This is a subset of the list above which was manually retrieved from Revit's UI
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.FreeformElement.baseGeometry">
<summary>
DEPRECATED. Sets the geometry contained in the FreeformElement. This field has been deprecated in favor of `baseGeometries`
to align with Revit's API. It remains as a setter-only property for backwards compatibility.
It will set the first item on the baseGeometries list, and instantiate a list if necessary.
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.Parameter.isShared">
<summary>
If True it's a Shared Parameter, in which case the ApplicationId field will contain this parameter GUID,
otherwise it will store its BuiltInParameter name
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.Parameter.isTypeParameter">
<summary>
True = Type Parameter, False = Instance Parameter
</summary>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitElement">
<summary>
A generic Revit element for which we don't have direct conversions
</summary>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitSymbolElementType">
<summary>
Represents the FamilySymbol subclass of ElementType in Revit
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitSymbolElementType.placementType">
<summary>
The type of placement for this family symbol
</summary>
<remarks> See https://www.revitapidocs.com/2023/2abb8627-1da3-4069-05c9-19e4be5e02ad.htm </remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitSymbolElementType.elements">
<summary>
Subcomponents found in this family symbol
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitRoof.RevitExtrusionRoof.#ctor(System.String,System.String,System.Double,System.Double,Objects.Geometry.Line,Objects.BuiltElements.Level,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit extrusion roof
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="start"></param>
<param name="end"></param>
<param name="referenceLine"></param>
<param name="level"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="start"/> and <paramref name="end"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitWall.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Double,System.Double,System.Boolean,System.Boolean,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit wall
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="topLevel"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="flipped"></param>
<param name="structural"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="baseOffset"/> and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitWall.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Boolean,System.Boolean,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit wall
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="height"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="flipped"></param>
<param name="structural"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="height"/>, <paramref name="baseOffset"/>, and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Duct.#ctor(Objects.Geometry.Line,System.Double,System.Double,System.Double,System.Double)">
<summary>
SchemaBuilder constructor for a Speckle duct
@ -339,6 +121,14 @@
The connections between <see cref="P:Objects.BuiltElements.Network.elements"/>
</summary>
</member>
<member name="P:Objects.BuiltElements.NetworkElement.elements">
<summary>
The Base object representing the element in the network (eg Pipe, Duct, etc)
</summary>
<remarks>
Currently named "elements" to assist with receiving in connector flatten method.
</remarks>
</member>
<member name="P:Objects.BuiltElements.NetworkElement.linkIndices">
<summary>
The index of the links in <see cref="P:Objects.BuiltElements.NetworkElement.network"/> that are connected to this element
@ -465,17 +255,255 @@
The radius of the bend of the hook.
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.DirectShape.#ctor(System.String,Objects.BuiltElements.Revit.RevitCategory,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
Constructs a new <see cref="T:Objects.BuiltElements.Revit.DirectShape"/> instance given a list of <see cref="T:Speckle.Core.Models.Base"/> objects.
</summary>
<param name="name">The name of the <see cref="T:Objects.BuiltElements.Revit.DirectShape"/></param>
<param name="category">The <see cref="T:Objects.BuiltElements.Revit.RevitCategory"/> of this instance.</param>
<param name="baseGeometries">A list of base classes to represent the direct shape (only mesh and brep are allowed, anything else will be ignored.)</param>
<param name="parameters">Optional Parameters for this instance.</param>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitFamilyCategory">
<summary>
FamilyDocuments can only be assigned these categories
This is a subset of the list above which was manually retrieved from Revit's UI
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.FreeformElement.baseGeometry">
<summary>
DEPRECATED. Sets the geometry contained in the FreeformElement. This field has been deprecated in favor of `baseGeometries`
to align with Revit's API. It remains as a setter-only property for backwards compatibility.
It will set the first item on the baseGeometries list, and instantiate a list if necessary.
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.Parameter.isShared">
<summary>
If True it's a Shared Parameter, in which case the ApplicationId field will contain this parameter GUID,
otherwise it will store its BuiltInParameter name
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.Parameter.isTypeParameter">
<summary>
True = Type Parameter, False = Instance Parameter
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitColumn.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Double,System.Double,System.Boolean,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit column
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="topLevel"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="structural"></param>
<param name="rotation"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="baseOffset"/> and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitDuct.#ctor(System.String,System.String,Objects.Geometry.Line,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit duct (deprecated)
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitDuct.#ctor(System.String,System.String,Objects.ICurve,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit duct
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseCurve"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitFlexDuct.#ctor(System.String,System.String,Objects.ICurve,System.String,System.String,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,Objects.Geometry.Vector,Objects.Geometry.Vector,System.Double,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit flex duct
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseCurve"></param>
<param name="systemName"></param>
<param name="systemType"></param>
<param name="level"></param>
<param name="width"></param>
<param name="height"></param>
<param name="diameter"></param>
<param name="velocity"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="width"/>, <paramref name="height"/>, and <paramref name="diameter"/> params</remarks>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitElement">
<summary>
A generic Revit element for which we don't have direct conversions
</summary>
</member>
<member name="T:Objects.BuiltElements.Revit.RevitSymbolElementType">
<summary>
Represents the FamilySymbol subclass of ElementType in Revit
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitSymbolElementType.placementType">
<summary>
The type of placement for this family symbol
</summary>
<remarks> See https://www.revitapidocs.com/2023/2abb8627-1da3-4069-05c9-19e4be5e02ad.htm </remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitSymbolElementType.elements">
<summary>
Subcomponents found in this family symbol
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitLevel.#ctor(System.String,System.Double,System.Boolean,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit level
</summary>
<param name="name"></param>
<param name="elevation"></param>
<param name="createView"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="elevation"/> param</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkElement.isCurveBased">
<summary>
Indicates if this element was constructed from an MEP curve
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkElement.isConnectorBased">
<summary>
Indicates if this element needs temporary placeholder objects to be created first when receiving
</summary>
<remarks>
For example, some fittings cannot be created based on connectors, and so will be created similarly to mechanical equipment
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.systemName">
<summary>
The system category
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.shape">
<summary>
The connector profile shape of the <see cref="T:Objects.BuiltElements.NetworkLink"/>
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.domain">
<summary>
The link domain
</summary>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.fittingIndex">
<summary>
The index indicating the position of this link on the connected fitting element, if applicable
</summary>
<remarks>
Revit fitting links are 1-indexed. For example, "T" fittings will have ordered links from index 1-3.
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.needsPlaceholders">
<summary>
Indicates if this link needs temporary placeholder objects to be created first when receiving
</summary>
<remarks>
Placeholder geometry are curves.
For example, U-bend links need temporary pipes to be created first, if one or more linked pipes have not yet been created in the network.
</remarks>
</member>
<member name="P:Objects.BuiltElements.Revit.RevitNetworkLink.isConnected">
<summary>
Indicates if this link has been connected to its elements
</summary>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitShaft.#ctor(Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit shaft
</summary>
<param name="outline"></param>
<param name="bottomLevel"></param>
<param name="topLevel"></param>
<param name="parameters"></param>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitRoof.RevitExtrusionRoof.#ctor(System.String,System.String,System.Double,System.Double,Objects.Geometry.Line,Objects.BuiltElements.Level,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit extrusion roof
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="start"></param>
<param name="end"></param>
<param name="referenceLine"></param>
<param name="level"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="start"/> and <paramref name="end"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitWall.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,Objects.BuiltElements.Level,System.Double,System.Double,System.Boolean,System.Boolean,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit wall
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="topLevel"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="flipped"></param>
<param name="structural"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="baseOffset"/> and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Revit.RevitWall.#ctor(System.String,System.String,Objects.ICurve,Objects.BuiltElements.Level,System.Double,System.Double,System.Double,System.Boolean,System.Boolean,System.Collections.Generic.List{Speckle.Core.Models.Base},System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Revit wall
</summary>
<param name="family"></param>
<param name="type"></param>
<param name="baseLine"></param>
<param name="level"></param>
<param name="height"></param>
<param name="baseOffset"></param>
<param name="topOffset"></param>
<param name="flipped"></param>
<param name="structural"></param>
<param name="elements"></param>
<param name="parameters"></param>
<remarks>Assign units when using this constructor due to <paramref name="height"/>, <paramref name="baseOffset"/>, and <paramref name="topOffset"/> params</remarks>
</member>
<member name="M:Objects.BuiltElements.Room.#ctor(System.String,System.String,Objects.BuiltElements.Level,Objects.Geometry.Point)">
<summary>
SchemaBuilder constructor for a Room
</summary>
<remarks>Assign units when using this constructor due to <paramref name="height"/> param</remarks>
<remarks>Assign units when using this constructor due to <see cref="P:Objects.BuiltElements.Room.height"/> prop</remarks>
</member>
<member name="M:Objects.BuiltElements.Room.#ctor(System.String,System.String,Objects.BuiltElements.Level,Objects.Geometry.Point,System.Collections.Generic.List{Objects.BuiltElements.Revit.Parameter})">
<summary>
SchemaBuilder constructor for a Room
</summary>
<remarks>Assign units when using this constructor due to <paramref name="height"/> param</remarks>
<remarks>Assign units when using this constructor due to <see cref="P:Objects.BuiltElements.Room.height"/> prop</remarks>
</member>
<member name="M:Objects.BuiltElements.Wall.#ctor(System.Double,Objects.ICurve,System.Collections.Generic.List{Speckle.Core.Models.Base})">
<summary>
@ -939,7 +967,6 @@
<member name="P:Objects.Geometry.ControlPoint.value">
<summary>
OBSOLETE - This is just here for backwards compatibility.
You should not use this for anything. Access coordinates using X,Y,Z and weight fields.
</summary>
</member>
<member name="M:Objects.Geometry.Curve.#ctor">
@ -1002,7 +1029,7 @@
</member>
<member name="M:Objects.Geometry.Curve.ToList">
<summary>
Returns the vales of this <see cref="T:Objects.Geometry.Curve"/> as a list of numbers
Returns the values of this <see cref="T:Objects.Geometry.Curve"/> as a list of numbers
</summary>
<returns>A list of values representing the <see cref="T:Objects.Geometry.Curve"/></returns>
</member>
@ -1131,10 +1158,10 @@
</member>
<member name="M:Objects.Geometry.Mesh.GetTextureCoordinate(System.Int32)">
<summary>
Gets a texture coordinate as a <see cref="!:(T1, T2)"/> by <paramref name="index"/>
Gets a texture coordinate as a <see cref="T:System.ValueTuple`2"/> by <paramref name="index"/>
</summary>
<param name="index">The index of the texture coordinate</param>
<returns>Texture coordinate as a <see cref="!:(T1, T2)"/></returns>
<returns>Texture coordinate as a <see cref="T:System.ValueTuple`2"/></returns>
</member>
<member name="M:Objects.Geometry.Mesh.AlignVerticesWithTexCoordsByIndex">
<summary>
@ -1235,7 +1262,7 @@
<param name="x">The x coordinate</param>
<param name="y">The y coordinate</param>
<param name="z">The z coordinate</param>
<param name="units">The units the point's coordinates are in.</param>
<param name="units">The units of the point's coordinates. Defaults to Meters. </param>
<param name="applicationId">The object's unique application ID</param>
</member>
<member name="M:Objects.Geometry.Point.#ctor(Objects.Geometry.Vector)">
@ -1266,13 +1293,10 @@
</member>
<member name="P:Objects.Geometry.Point.units">
<summary>
The unit's this <see cref="T:Objects.Geometry.Vector"/> is in.
The units this <see cref="T:Objects.Geometry.Point"/> is in.
This should be one of the units specified in <see cref="T:Speckle.Core.Kits.Units"/>
</summary>
</member>
<member name="P:Objects.Geometry.Point.bbox">
<inheritdoc/>
</member>
<member name="M:Objects.Geometry.Point.TransformTo(Objects.Other.Transform,Objects.Geometry.Point@)">
<inheritdoc/>
</member>
@ -1693,7 +1717,7 @@
Sets the control points of this <see cref="T:Objects.Geometry.Surface"/>.
</summary>
<param name="value">A 2-dimensional array of <see cref="T:Objects.Geometry.ControlPoint"/> instances.</param>
<remarks>The <see cref="!:value"/> must be ordered following directions "[u][v]"</remarks>
<remarks>The <paramref name="value"/> must be ordered following directions "[u][v]"</remarks>
</member>
<member name="M:Objects.Geometry.Surface.ToList">
<summary>
@ -1988,7 +2012,7 @@
</member>
<member name="T:Objects.Organization.ModelInfo">
<summary>
Basic model info class to be attached to the <see cref="!:Model.info"/> field on a <see cref="!:Model"/> object.
Basic model info class
It contains general information about the model and can be extended or subclassed to include more application-specific
information.
</summary>
@ -2005,8 +2029,7 @@
</member>
<member name="T:Objects.Organization.BIMModelInfo">
<summary>
Extended <see cref="T:Objects.Organization.ModelInfo"/> to be attached to the <see cref="!:Model.info"/> field on a <see cref="!:Model"/> object.
This contains additional properties applicable to AEC projects.
Extended <see cref="T:Objects.Organization.ModelInfo"/> to contain additional properties applicable to AEC projects.
</summary>
</member>
<member name="P:Objects.Organization.BIMModelInfo.clientName">
@ -2203,18 +2226,6 @@
<remarks>This method will skip scaling. If you need scaling, we recommend using the transform instead.</remarks>
<returns>A Plane on the insertion point of this Block Instance, with the correct 3-axis rotations.</returns>
</member>
<member name="M:Objects.Other.Revit.RevitInstance.GetInsertionPlane">
<summary>
Returns a plane representing the insertion point and orientation of this revit instance.
</summary>
<remarks>This method will skip scaling. If you need scaling, we recommend using the transform instead.</remarks>
<returns>A Plane on the insertion point of this Block Instance, with the correct 3-axis rotations.</returns>
</member>
<member name="T:Objects.Other.Revit.RevitMaterial">
<summary>
Material in Revit defininf all revit properties from Autodesk.Revit.DB.Material
</summary>
</member>
<member name="T:Objects.Other.Material">
<summary>
Generic class for materials containing generic parameters
@ -2240,6 +2251,18 @@
And: https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/
</summary>
</member>
<member name="M:Objects.Other.Revit.RevitInstance.GetInsertionPlane">
<summary>
Returns a plane representing the insertion point and orientation of this revit instance.
</summary>
<remarks>This method will skip scaling. If you need scaling, we recommend using the transform instead.</remarks>
<returns>A Plane on the insertion point of this Block Instance, with the correct 3-axis rotations.</returns>
</member>
<member name="T:Objects.Other.Revit.RevitMaterial">
<summary>
Material in Revit defininf all revit properties from Autodesk.Revit.DB.Material
</summary>
</member>
<member name="T:Objects.Other.Text">
<summary>
Text class for Rhino and AutoCAD
@ -2367,7 +2390,6 @@
<summary>
SchemaBuilder constructor for a structural model object
</summary>
<param name="modelInfo"></param>
<param name="nodes"></param>
<param name="elements"></param>
<param name="loads"></param>
@ -2435,18 +2457,6 @@
<param name="orientationNode"></param>
<param name="orientationAngle"></param>
</member>
<member name="M:Objects.Structural.GSA.Geometry.GSANode.#ctor(System.Int32,Objects.Geometry.Point,Objects.Structural.Geometry.Restraint,Objects.Structural.Geometry.Axis,Objects.Structural.Properties.PropertySpring,Objects.Structural.Properties.PropertyMass,Objects.Structural.Properties.PropertyDamper,System.Double,System.String)">
<summary>
SchemaBuilder constructor for a GSA node
</summary>
<param name="basePoint"></param>
<param name="restraint"></param>
<param name="constraintAxis"></param>
<param name="springProperty"></param>
<param name="massProperty"></param>
<param name="damperProperty"></param>
<param name="localElementSize"></param>
</member>
<member name="M:Objects.Structural.Geometry.Element1D.#ctor(Objects.Geometry.Line,Objects.Structural.Properties.Property1D,Objects.Structural.Geometry.ElementType1D,System.String,Objects.Structural.Geometry.Restraint,Objects.Structural.Geometry.Restraint,Objects.Geometry.Vector,Objects.Geometry.Vector,Objects.Geometry.Plane)">
<summary>
SchemaBuilder constructor for structural 1D element (based on local axis)
@ -2483,6 +2493,18 @@
<param name="name">The name of the storey</param>
<param name="elevation">The elevation of the storey (along the global z-axis, ie. storey exists in the global XY plane)</param>
</member>
<member name="M:Objects.Structural.GSA.Geometry.GSANode.#ctor(System.Int32,Objects.Geometry.Point,Objects.Structural.Geometry.Restraint,Objects.Structural.Geometry.Axis,Objects.Structural.Properties.PropertySpring,Objects.Structural.Properties.PropertyMass,Objects.Structural.Properties.PropertyDamper,System.Double,System.String)">
<summary>
SchemaBuilder constructor for a GSA node
</summary>
<param name="basePoint"></param>
<param name="restraint"></param>
<param name="constraintAxis"></param>
<param name="springProperty"></param>
<param name="massProperty"></param>
<param name="damperProperty"></param>
<param name="localElementSize"></param>
</member>
<member name="M:Objects.Structural.Loading.Load.#ctor(System.String,Objects.Structural.Loading.LoadCase)">
<summary>
A generalised structural load, described by a name and load case
@ -2620,7 +2642,7 @@
</member>
<member name="M:Objects.Utils.MeshTriangulationHelper.TriangulateMesh(Objects.Geometry.Mesh,System.Boolean)">
<summary>
Triangulates all faces in <paramref name="Mesh"/>.
Triangulates all faces in <paramref name="mesh"/>.
</summary>
<param name="mesh">The mesh to triangulate.</param>
<param name="preserveQuads">If <see langword="true"/>, will not triangulate quad faces.</param>
@ -2631,13 +2653,13 @@
</member>
<member name="M:Objects.Utils.MeshTriangulationHelper.TriangulateFace(System.Int32,System.Collections.Generic.IReadOnlyList{System.Int32},System.Collections.Generic.IReadOnlyList{System.Double},System.Boolean)">
<summary>
Calculates the triangulation of the face at <paramref name="faceIndex"/> in <paramref name="mesh"/>.
Calculates the triangulation of the face at <paramref name="faceIndex"/> in <paramref name="faces"/> list.
</summary>
<remarks>
This implementation is based the ear clipping method
Proposed by "Christer Ericson (2005) <i>Real-Time Collision Detection</i>".
</remarks>
<param name="faceIndex">The index of the face's cardinality indicator <c>n</c> in <paramref name="mesh"/>.<see cref="P:Objects.Geometry.Mesh.faces"/></param>.
<param name="faceIndex">The index of the face's cardinality indicator <c>n</c> in <paramref name="faces"/> list</param>.
<param name="faces"></param>
<param name="vertices"></param>
<param name="includeIndicators">if <see langword="true"/>, the returned list will include cardinality indicators for each triangle

Просмотреть файл

@ -1,6 +1,7 @@
#nullable enable
using System;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;
@ -111,9 +112,9 @@ namespace Speckle.ConnectorUnity.Utils
public readonly Task Task;
public override bool keepWaiting => !Task.IsCompleted;
public WaitForTask(Func<Task> function)
public WaitForTask(Func<Task> function, CancellationToken cancellationToken = default)
{
Task = Task.Run(function);
Task = Task.Run(function, cancellationToken);
}
}
@ -124,9 +125,12 @@ namespace Speckle.ConnectorUnity.Utils
public TResult Result => Task.Result;
public override bool keepWaiting => !Task.IsCompleted;
public WaitForTask(Func<Task<TResult>> function)
public WaitForTask(
Func<Task<TResult>> function,
CancellationToken cancellationToken = default
)
{
this.Task = System.Threading.Tasks.Task.Run(function);
this.Task = System.Threading.Tasks.Task.Run(function, cancellationToken);
}
}
}

Просмотреть файл

@ -30,7 +30,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection
if (value is null)
return null;
return value.id + Crypt.Hash(value.serverInfo.url ?? "");
return value.id + Crypt.Md5(value.serverInfo.url ?? "", "X2");
}
public override void RefreshOptions()

Просмотреть файл

@ -87,7 +87,7 @@ namespace Speckle.ConnectorUnity.Wrappers.Selection
index++;
}
string? currentSelected = KeyFunction(Selected);
string? currentSelected = selectedId;
if (currentSelected is null || !indexMap.ContainsKey(currentSelected))
{
selectedId = defaultOption;

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "systems.speckle.speckle-unity",
"version": "2.17.1",
"version": "2.18.0-rc1",
"displayName": "Speckle Unity Connector",
"description": "AEC Interoperability for Unity through Speckle",
"unity": "2021.1",
@ -21,4 +21,4 @@
"email": "hello@speckle.systems",
"url": "https://speckle.systems"
}
}
}

Просмотреть файл

@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.22f1
m_EditorVersionWithRevision: 2021.3.22f1 (b6c551784ba3)
m_EditorVersion: 2021.3.30f1
m_EditorVersionWithRevision: 2021.3.30f1 (b4360d7cdac4)