Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-10 Thread AK Eric
Another great solution, thanks! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-10 Thread Joss13
And it will work in python as well: import sys, os, shutil, subprocess, time curdir = os.path.dirname(__file__) target = os.path.join(curdir, 'test_subject.txt') target2 = os.path.join(curdir, 'test_subject.txt:attr1') shutil.copy2('c:/windows/explorer.exe', target) os.system('dir /r')

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-10 Thread Joss13
Some more examples here: http://www.flexhex.com/docs/articles/alternate-streams.phtml On Thursday, May 10, 2018 at 12:31:27 PM UTC-7, Joss13 wrote: > > > > On Thursday, May 3, 2018 at 3:26:33 PM UTC-7, Marcus Ottosson wrote: >> >> Basically you can write anything to your >>

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-10 Thread Kthulhu Fhtagn
On Thursday, May 3, 2018 at 3:26:33 PM UTC-7, Marcus Ottosson wrote: > > Basically you can write anything to your > “c:/project/mayascene.mb:trololo”, “:attr1”, “:whatever” even with the > shell commands, or your file manager. > > Sounds interesting! Would you be able to post an example?​ >

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-03 Thread Marcus Ottosson
Basically you can write anything to your “c:/project/mayascene.mb:trololo”, “:attr1”, “:whatever” even with the shell commands, or your file manager. Sounds interesting! Would you be able to post an example?​ ​ -- You received this message because you are subscribed to the Google Groups

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-05-03 Thread ajoss
On Tuesday, February 13, 2018 at 8:56:56 PM UTC-8, AK Eric wrote: > Right on, credit :) > > > FYI, I figured out you can use cpickle.dumps to embed arbitrary python data > straight into the value of fileInfo, allowing you to query it outside of > Maya, powerful. > > > However, on large files

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-04-17 Thread Mark Jackson
Damn this is a nice idea, never thought of the fileInfo command, I've got to dig into this thanks guys! On 14 February 2018 at 04:56, AK Eric wrote: > Right on, credit :) > > FYI, I figured out you can use cpickle.dumps to embed arbitrary python > data straight into the

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-13 Thread AK Eric
Right on, credit :) FYI, I figured out you can use cpickle.dumps to embed arbitrary python data straight into the value of fileInfo, allowing you to query it outside of Maya, powerful. However, on large files (200+megs) it can still take a good 20 seconds to parse. I may end up just storing

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-12 Thread Marcus Ottosson
Glad it works, however I can't take much credit for the parser; I believe most of the work is originally from cgkit, and the rest from the parent repository of my fork, https://github.com/agibli/sansapp On 12 February 2018 at 17:50, AK Eric wrote: > Thanks Alok & Marcus:

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-12 Thread AK Eric
Thanks Alok & Marcus: I tried that code and it does indeed work. Nice job on the scenefile parser Marcus! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-12 Thread Marcus Ottosson
By golly, that does actually work! from maya_scenefile_parser import MayaBinaryParser fname = "C:/Users/marcus/Desktop/temp.mb" class Parser(MayaBinaryParser): def on_file_info(self, key, value): print("%s = %s" % (key, value)) with open(fname, "rb") as f: parser = Parser(f)

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-12 Thread Alok Gandhi
Why not use the fileInfo() to store the data? Can be read outside maya as well by parsing the ma/mb Sent from my iPhone > On 12-Feb-2018, at 00:10, Juan Cristóbal Quesada > wrote: > > following your attempts at using cPickle in mb files which seems interesting >

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread Ian Jones
Well if you like your MB and your current json/xml file solution but just want them tied together so they don't get disconnected you may want to consider just using a .zip to bind them. Uncompressed they can be very fast and you can access files directly (to query your metadata etc) without having

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread AK Eric
Marcus: MA not an option, so no comment blocks, but thanks, good idea. However, I like your idea of just writing data to somewhere on the server that corresponds to the Maya file in question. That could be a legit answer. not tagging the file with metadata itself, but the data isn't living

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread Juan Cristóbal Quesada
following your attempts at using cPickle in mb files which seems interesting to me... Cant you just append a binary datablock with your data at the end of the .mb file and just preprocess the file reading and deleting that appended block of data before opening the file in Maya? If you do it

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread Juan Cristóbal Quesada
following your attempts at using cPickle in mb files which seems interesting to me... Cant you just append a binary datablock with your data at the end of the .mb file and just preprocess the file reading and deleting that appended block of data before opening the file in Maya? If you do it

Re: [Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread Marcus Ottosson
If .ma is an option, then it supports comment blocks. // Comment here ... addAttr ... connectAttr.. A perhaps more common approach might be to store metadata relative an absolute path in a database. { "c:\path\to\some\file.mb": { "any": "data", "here": True }} Then you can query

[Maya-Python] Re: Tagging MB files with metadata

2018-02-11 Thread fruityfrank
I'd be curious to find something as well ! I had a quick look at it ages ago, and couldn't find anything robust. If you're on Unix, you can attach infos against a file (including a .mb), but that doesn't seem to exist on windows. And I'd like to find something cross-platform You can also write