Code Monkey home page Code Monkey logo

forge.commandline-curl's People

Contributors

autodesk-adn avatar calvin avatar cyrillef avatar jaylimboonkiat avatar kimekeunkyung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

forge.commandline-curl's Issues

Visualising HTML Demo

Hi all,

I'm trying to run the "workflow curl" example and everything works fine except the visualisation of the model. When I open the html file, it raises the following errors:

viewer3D.min.js:847 Uncaught ReferenceError: THREE is not defined
viewer3D.min.js:1193 Uncaught TypeError: Cannot read property 'resize' of undefined

I added the three.js library to /temp/Au.obj.html from http://threejs.org/build/three.min.js. I ran the html again and it raised the following error:

Uncaught TypeError: THREE.DDSLoader is not a function

I added the THREE.DDSLoader library and it loads the model but it raises all these errors in the console:

HREE.WebGLRenderer 71
viewer3D.min.js:1871 Host name : localhost
viewer3D.min.js:1871 Environment initialized as : AutodeskProduction
viewer3D.min.js:1872 No viewer version specified, will implicitly use 1.2.16
three.min.js:263 GET http://localhost:8888/workflow-curl-view-and-data-api/temp/res/environments/riverbank_irr.logluv.dds 404 (Not Found)THREE.XHRLoader.load @ three.min.js:263THREE.CompressedTextureLoader.load @ three.min.js:296setIrradianceMap @ viewer3D.min.js:770setLightPreset @ viewer3D.min.js:882a.Viewer3D.initSettings @ viewer3D.min.js:1218a.Viewer3D.initialize @ viewer3D.min.js:1183initialize @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:17onload @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:10
three.min.js:263 GET http://localhost:8888/workflow-curl-view-and-data-api/temp/res/environments/riverbank_mipdrop.logluv.dds 404 (Not Found)THREE.XHRLoader.load @ three.min.js:263THREE.CompressedTextureLoader.load @ three.min.js:296setCubeMap @ viewer3D.min.js:768setLightPreset @ viewer3D.min.js:882a.Viewer3D.initSettings @ viewer3D.min.js:1218a.Viewer3D.initialize @ viewer3D.min.js:1183initialize @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:17onload @ Au.obj.html?accessToken=TOXd9AQnlm8cIKjfHrFGoUe8DM87:10
2DSLoader.js:129 THREE.DDSLoader.parse: Invalid magic number in DDS header.THREE.DDSLoader.parse @ DSLoader.js:129(anonymous function) @ three.min.js:296(anonymous function) @ three.min.js:262
viewer3D.min.js:1238 Autodesk.Viewing.Document.load called with deprecated (auth) parameter
developer.api.autodesk.com/oss-ext/v1/acmsessions:1 POST https://developer.api.autodesk.com/oss-ext/v1/acmsessions 401 (Unauthorized)
Setting 'XMLHttpRequest.withCredentials' for synchronous requests is deprecated.

Is this the normal behaviour of the viewer?
Thanks

wish: command to display currently supported file formats

something along these lines:

./viewerAPI auth

returns bearer.

a suitable CURL command to return file formats is shown in 'step 4 โ€“ upload a file':

https://developer.autodesk.com/api/view-and-data-api/#step-4-upload-a-file

curl  -k --header "Authorization: Bearer tMpDT9fGcWsQVd5BG5XUqpYUBbpR" https://developer.api.autodesk.com/viewingservice/v1/supported

massage the result returned, e.g. like this in Python:

a = {"extensions":["ipt","neu","stla","stl","xlsx","jt","jpg","skp","prt","dwf","xls","png","sldasm","step","dwg","zip","nwc","model","sim","stp","ste","f3d","pdf","iges","idw","dwt","dxf","catproduct","csv","igs","sldprt","cgr","3dm","sab","obj","pptx","cam360","jpeg","bmp","gbxml","exp","ppt","doc","wire","ige","rcp","txt","dae","x_b","3ds","rtf","rvt","g","sim360","iam","asm","dlv3","x_t","pps","session","xas","xpr","docx","catpart","stlb","tiff","nwd","sat","fbx","smb","smt","ifc","dwfx","tif"], ... }

a['extensions'].sort()

for e in a['extensions']: print e,

result:

  • 3dm 3ds asm bmp cam360 catpart catproduct cgr csv dae dlv3 doc docx dwf dwfx dwg dwt dxf exp f3d fbx g gbxml iam idw ifc ige iges igs ipt jpeg jpg jt model neu nwc nwd obj pdf png pps ppt pptx prt rcp rtf rvt sab sat session sim sim360 skp sldasm sldprt smb smt ste step stl stla stlb stp tif tiff txt wire x_b x_t xas xls xlsx xpr zip

oops, those are too many, both for viewing and extraction only.

to get the viewing ones, filter them like this:

channel_mappings = a['channelMapping']
keys = channel_mappings.keys()
keys.sort()
for x in keys:
  if channel_mappings[x].startswith('view'):
    print x,

result:

  • 3dm 3ds asm cam360 catpart catproduct cgr dae dlv3 dwf dwfx dwg dwt dxf exp f3d fbx g gbxml iam idw ifc ige iges igs ipt jt model neu nwc nwd obj prt rcp rvt sab sat session sim sim360 skp sldasm sldprt smb smt ste step stl stla stlb stp wire x_b x_t xas xpr zip

spaces in file path corrupt location

i uploaded the following file from my windows file system:

/a/src/web/viewer/git/workflow-curl-view.and.data.api/ $ ./viewerAPI upload "/v/C/Program Files/Autodesk/Revit 2016/Samples/rst_advanced_sample_project.rvt"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.2M 100 499 100 11.2M 3 82150 0:02:46 0:02:23 0:00:23 21352
{
"bucket-key": "comphound-bucket",
"objects": [
{
"content-type": "application/octet-stream",
"id": "urn:adsk.objects:os.object:comphound-bucket/Program+Revit+rst_advanced_sample_project.rvt",
"key": "Program+Revit+rst_advanced_sample_project.rvt",
"location": "https://developer.api.autodesk.com/oss/v1/buckets/comphound-bucket/objects/Program+Revit+rst_advanced_sample_project.rvt",
"sha-1": "8b7e00fbed8f80467b6a54b37f7fdcace2044236",
"size": 11792384
}
]
}
ID: urn:adsk.objects:os.object:comphound-bucket/Program+Revit+rst_advanced_sample_project.rvt
Location: https://developer.api.autodesk.com/oss/v1/buckets/comphound-bucket/objects/Program+Revit+rst_advanced_sample_project.rvt

look at the resulting location: it includes the first word of some intermediate folder names!

when i try to register, it is not obviously found:

/a/src/web/viewer/git/workflow-curl-view.and.data.api/ $ ./viewerAPI register rst_advanced_sample_project.rvt
cat: /Users/jta/a/src/web/viewer/git/workflow-curl-view.and.data.api/data/comphound-bucket.rst_advanced_sample_project.rvt.json: No such file or directory
Traceback (most recent call last):
File "", line 1, in
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 290, in load
**kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/init.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 53 100 43 100 10 45 10 0:00:01 --:--:-- 0:00:01 102
Registration submission failed!
HTTP/1.1 400 Bad Request Access-Control-Allow-Credentials: true Access-Control-Allow-Origin: * Content-Type: application/json; charset=utf-8 Date: Thu, 01 Oct 2015 15:19:56 GMT Server: Apigee Router x-ads-app-identifier: platform-viewing-2015.06.6.1053.c60682a-production x-ads-duration: 0 ms x-ads-error-id: x-ads-exception-id: 19fed11e-50dd-454d-a1f9-309e62e700e4 x-ads-startup-time: Thu Oct 01 03:07:15 UTC 2015 x-ads-troubleshooting: The request is invalid. Content-Length: 43 Connection: keep-alive {"diagnostic":"'urn' parameter is invalid"}

no support for models with spaces in the path name

i tried the following command:

$ ./viewerAPI upload "/a/rvt/Urban House - 2015.rvt" 

that returns the following:

curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
No JSON object could be decoded
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
ID: 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Location: 
/Users/jta/a/src/web/viewer/git/workflow-curl-view.and.data.api/scripts/upload: line 59: $ROOT/data/${bucket}.${filename}.json: ambiguous redirect

second version? 1.0.1?

shall we create a new release now? e.g., 1.0.0.1 or something? i see that npm uses a release numbering system using 3 numbers, not 4? shall we switch from 1.0.0.0 to 2.0.0? or 1.0.1?

resumable script fails when using filename with spaces

I'm getting an error when using resumable script on file which contains spaces. Using quotes around filename works fine on simple upload.
The error message is:
tail: cannot open 'nnn' for reading: No such file or directory - where 'nnn' is first part of filename
I'm using script on Windows 10 (together with Git Bash)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.