mcneel / rhinocommon

RhinoCommon is the .NET SDK for Rhino5 / Grasshopper
http://wiki.mcneel.com/developer/rhinocommon
244 stars 93 forks source link

Reading image byte[] in FileReference.ContentHash.Sha1ContentHash #188

Closed blackpandastudios closed 5 years ago

blackpandastudios commented 5 years ago

I'm trying to read texture data from rhino projects, I have been successful in doing so when the file exists on disk by reading FileReference.FullPath. However, I am having trouble reading cached textures.

I open a project in rhino and I can see rhino is reading cached textures (ones I don't have on disk), however, I have been having trouble doing the same.

I tried creating a texture by just passing the byte array from FileReference.ContentHash.Sha1ContentHash into my LoadImageFromBytes method (this works with bytes that were read from png's and jpeg's on disk, just not the hash).

I'm likely just misinterpreting what the data stored actually is, so sorry if this seems like a silly question, it's just the last thing I want to do for integrating 3dm files with our software.

Regards, Joel

blackpandastudios commented 5 years ago

Ignore this, I realized rhino isn't caching images and the image did in fact exist on disk.