This file contains hidden or 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
| import time | |
| import jwt | |
| import requests | |
| class AuthenticationHandler: | |
| """ | |
| Authentication handler for Service-to-Service Authentication (SSA) with Autodesk Platform Services. |
This file contains hidden or 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
| """ | |
| OAuth2 Authentication Helper for M&E Data SDK | |
| For production use, please implement your own authentication handler with the help of ADSK documentation. | |
| This is just a simple quickstart solution to get authenticated. | |
| It opens a local HTTP server to listen for the OAuth2 redirect with the authorization code, | |
| exchanges the code for tokens, and manages token refreshing. | |
| """ |
This file contains hidden or 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
| testing |
This file contains hidden or 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
| collection of images used in Drawing App tutorial |
This file contains hidden or 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
| hfdm_screenshot |
This file contains hidden or 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
| function getFragment(NodeId) { | |
| tree.enumNodeFragments(NodeId, function (frag) { | |
| console.log("Object " | |
| + tree.getNodeName(NodeId) | |
| + "with parrent " | |
| + tree.getNodeName(tree.getNodeParentId(NodeId)) | |
| + " has fragment " | |
| + frag); | |
| }); | |
| } |
This file contains hidden or 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
| int Informix::Display(TimeValue t, INode* inode, ViewExp* vpt, int flagst, ModContext* mc) | |
| { | |
| TimeValue current_time = GetCOREInterface()->GetTime(); | |
| Box3 bounding_box; | |
| inode->EvalWorldState(current_time).obj->GetLocalBoundBox(current_time, inode,vpt,bounding_box); | |
| Point3 min = bounding_box.Min(); | |
| Point3 max = bounding_box.Max(); | |
| Point3 x_max(max.x, min.y, min.z); | |
| Point3 y_max(min.x, max.y, min.z); | |
| Point3 z_max(min.x, min.y, max.z); |
This file contains hidden or 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
| void Informix::makeWingsidePoints( Point3 reference_point, | |
| Point3 &wing_side_point, | |
| Point3 &wing_other_side_point, | |
| float arrow_wing_factor, | |
| const Point3 source) | |
| { | |
| wing_side_point = reference_point; | |
| wing_other_side_point = wing_side_point; | |
| if(reference_point.x != source.x) |
This file contains hidden or 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
| void Informix::drawMyArrows(Point3 p1, Point3 p2, const wchar_t* my_text, ViewExp* vpt) | |
| { | |
| float arrow_scale_factor = 0.05; | |
| float arrow_wing_factor = 10.0f; // max(max(p1.z + p2.z, p1.x + p2.x)*arrow_scale_factor, 1); | |
| pblock2->GetValue(pb_wing_spin, GetCOREInterface()->GetTime(), arrow_wing_factor, FOREVER); | |
| Point3 wing_side_point(0,0,0); | |
| Point3 wing_other_side_point(0,0,0); | |
| Point3 ref_point((p1.x + p2.x), (p1.y + p2.y), (p1.z + p2.z)); | |
| Point3 midpoint = ref_point / 2; |
This file contains hidden or 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
| int Informix::Display(TimeValue t, INode* inode, ViewExp* vpt, int flagst, ModContext* mc) | |
| { | |
| GraphicsWindow *gw = vpt->getGW(); | |
| DrawLineProc lp(gw); | |
| lp.SetLineColor(1, 0, 0); | |
| Point3 my_gismo_points[5] = { Point3(0, 0, 0), Point3(-80, 0, 0), | |
| Point3(-60, 10, 0), Point3(-80, 0, 0), | |
| Point3(-60, -10, 0) }; | |
| lp.proc(my_gismo_points, 5); | |
| gw->setColor(TEXT_COLOR, 1, 1, 1); |