-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2125 from specklesystems/release/2.12
Release 2.12
- Loading branch information
Showing
323 changed files
with
7,099 additions
and
14,851 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
secret: | ||
ignored-matches: | ||
- match: "agZqxG4jQELxQQXh0iZQ" | ||
name: "SEQ ingestion api key" | ||
- match: "https://[email protected]/4504491155783680" | ||
name: "Sentry ingestion DNS" | ||
version: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
ConnectorArchicad/AddOn/Sources/AddOn/AttributeManager.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#include "AttributeManager.hpp" | ||
|
||
GSErrCode AttributeManager::GetMaterial (const ModelInfo::Material& material, API_Attribute& attribute) | ||
{ | ||
GS::UniString materialName (material.GetName ()); | ||
char typeId = API_MaterialID; | ||
GS::UniString key = materialName + typeId; | ||
|
||
if (cache.Get (key, &attribute)) { | ||
return NoError; | ||
} else { | ||
BNZeroMemory (&attribute, sizeof (API_Attribute)); | ||
|
||
attribute.header.uniStringNamePtr = &materialName; | ||
attribute.header.typeID = API_MaterialID; | ||
|
||
GSErrCode err = ACAPI_Attribute_Get (&attribute); | ||
if (NoError == err) { | ||
cache.Add (key, attribute); | ||
} | ||
|
||
if (APIERR_BADNAME == err) { | ||
attribute.material.mtype = APIMater_GeneralID; | ||
attribute.material.ambientPc = 100; | ||
attribute.material.diffusePc = 0; | ||
attribute.material.specularPc = 0; | ||
|
||
attribute.material.transpPc = material.GetTransparency (); | ||
attribute.material.shine = 50; | ||
attribute.material.transpAtt = 400; | ||
attribute.material.emissionAtt = 0; | ||
|
||
attribute.material.surfaceRGB.f_red = material.GetAmbientColor ().red / 65535.0; | ||
attribute.material.surfaceRGB.f_green = material.GetAmbientColor ().green / 65535.0; | ||
attribute.material.surfaceRGB.f_blue = material.GetAmbientColor ().blue / 65535.0; | ||
|
||
attribute.material.specularRGB.f_red = .0; | ||
attribute.material.specularRGB.f_green = .0; | ||
attribute.material.specularRGB.f_blue = .0; | ||
|
||
attribute.material.emissionRGB.f_red = material.GetEmissionColor ().red / 65535.0; | ||
attribute.material.emissionRGB.f_green = material.GetEmissionColor ().green / 65535.0; | ||
attribute.material.emissionRGB.f_blue = material.GetEmissionColor ().blue / 65535.0; | ||
|
||
err = ACAPI_Attribute_Create (&attribute, 0); | ||
if (NoError == err) { | ||
cache.Add (key, attribute); | ||
} | ||
} | ||
|
||
return err; | ||
} | ||
} | ||
|
||
|
||
GSErrCode AttributeManager::GetDefaultMaterial (API_Attribute& attribute, GS::UniString& name) | ||
{ | ||
GS_RGBColor ambientColor; | ||
ambientColor.red = 0x7f * 256; | ||
ambientColor.green = 0x7f * 256; | ||
ambientColor.blue = 0x7f * 256; | ||
|
||
GS_RGBColor emissionColor; | ||
emissionColor.red = 0x0; | ||
emissionColor.green = 0x0; | ||
emissionColor.blue = 0x0; | ||
|
||
name = "Default Speckle Surface"; | ||
ModelInfo::Material material (name, 0, ambientColor, emissionColor); | ||
|
||
return GetMaterial (material, attribute); | ||
} |
15 changes: 15 additions & 0 deletions
15
ConnectorArchicad/AddOn/Sources/AddOn/AttributeManager.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef ATTRIBUTE_MANAGER_HPP | ||
#define ATTRIBUTE_MANAGER_HPP | ||
|
||
#include "ModelInfo.hpp" | ||
|
||
class AttributeManager { | ||
private: | ||
GS::HashTable< GS::UniString, API_Attribute> cache; | ||
|
||
public: | ||
GSErrCode GetMaterial (const ModelInfo::Material& material, API_Attribute& attribute); | ||
GSErrCode GetDefaultMaterial (API_Attribute& attribute, GS::UniString& name); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.