Split maya render layers to files - scripting

I am trying to make a script in maya to export render layers to separate files. Though I am not clear on the logic to be applied for the script. I dont want any code just the procedure.
Can anyone please help.
Thanks in advance to all.

You can get all the render layers with
cmds.ls(type='renderLayer')
and the contents of each layer with
cmds.editRenderLayerMembers('layer-name-here', q=True)
You'l have to decide for yourself how to deal with objects that exist in multiple layers and so on.

Related

Tensorflow 2 creating custom dataset

I am trying to build a custom dataset-loader, which laods ICDAR-Dataset.
My frist step was to embed a dataset inside my loader as suggested also
here in this post, but the problem is that you have to implement all the nice features that the tenfsoflow-2 class "Dataset" offers manually.
My second try was to subclass the Dataset-Class, something like:
class MyDataset(tf.data.Dataset):
def __init__(self):
super(MyDataset, self).init()
def preprocess_images(self):
pass
But the problem is i did not find any documentation what dataset-class internally really does, the only implementation i found was this one.
So question is does anybody know how to build a custom "dataset" in tf2 by subclassing tf.data.Dataset.
By the way i also tried tensorflow_datasets, bit it does not really worked, shince it will downlaod the dataset, and split them manually which is in this is alreay seperated by train and test and also ICDAr can not be downlaoded without registration.
The content of the ICDAR-Dataset is as following:
An Image
A List of all texts in each image
A List of Bouding-boxes for each text in each image
Image:
#https://rrc.cvc.uab.es/?ch=4 owns the copyrights of this image.
Words and bounding boxes for the above image:
377,117,463,117,465,130,378,130,Genaxis Theatre
493,115,519,115,519,131,493,131,[06]
374,155,409,155,409,170,374,170,###
492,151,551,151,551,170,492,170,62-03
376,198,422,198,422,212,376,212,Carpark
494,190,539,189,539,205,494,206,###
374,1,494,0,492,85,372,86,###
Thanks
does anyone know how to

Psychopy ISI component and how to use it to load stimuli in the Builder

I am having some doubts whether I understand correctly the concept of static component or not.
I am designing an experiment where I am presenting images for certain durations and once an image is gone the participant will have to submit a response.
I am using the builder for this and usually at the end I go on the coder view to make some minor alterations (randomise inter-trial durations etc)
So in the builder, I start a loop where my first routine has an ISI component for 0.5 seconds, then I add an image ad 0.5 seconds, a second routine in the loop records the key response.
What I want to do, in order to avoid lag, is to load the image during the ISI and then display it after the 0.5 seconds have passed. I am ok with the condition file and how to use parameters as variables. So in the Image entry I use $image (as declared in my excel file), I also declare that I want this image to be set "during trial:ISI". Does this do what I have in mind? Load the image during ISI and flip it once ISI finishes?
Secondly, do you think it will be more efficient to have the ISI and the image in different routines inside the same loop?
If you have any other suggestions on how it can be done in a more efficient way please let me know.
Thank you.
(1) Yes, this is the correct way to use the ISI to pre-load an image.
(2) No, there is no need to split across different routines.
(3) You should avoid going "on the coder view to make some minor alterations". Once you make changes there, the Builder view can't be utilised any more. It is very likely that you can achieve what you want by putting code within a Code Component in the Builder view, so you don't have to abandon the advantages of the graphical interface.

Exporting map from TileMill to PDF/SVG

I have such a big problem with exporting and importing map from TileMill to Illustrator/Inkscape. The problem is with strokes of labels / names.
It seems that TileMill export each letter of label as a separate expanded path–object and doing an outline of that. The result is very bad. Take a look: http://cl.ly/image/0Z2o2v3v2r2C
Do you have any ideas how to fix it? Or maybe there is a solution to create a working text path in Illustrator from that kind of object?
This is unfortunately an upstream bug in Mapnik, and upstream from there in the raw SVG rendering libraries it uses.

Maya: Create temporary MFnMEsh for smooth export

Im writing an exporter that exports the subdivision preview mesh via the 'generateSmoothMesh()' method like this:
MFnMesh mesh(mesh_dag_path);
MFnMesh subdiv_mesh(mesh.generateSmoothMesh());
but after the export finishes the new subdivided geometry is left in my maya scene. How should i deal with this geometry, or is this even the right way to be doing this export?
my first instinct is to delete the geometry after the export is finished, if this is the correct thing to do does anybody know he correct way to delete the geometry from the api
Saying you need to do it from the API makes me think this is a command plugin. Correct me if I'm wrong. One way to do it is to run MEL code from your plugin with MGlobal .
MGlobal::executeCommand(MString("delete meshTransform;"));
Where meshTransform is the transform of the newly created mesh. You can get it by having parentOrOwner be MObject::kNullObj.
Or you can directly use:
MGlobal::deleteNode()

How do you assign a default Image to the Blob object in Play framework?

I followed this nice article
http://www.lunatech-research.com/playframework-file-upload-blob
and have a perfectly working image upload solution
My questions is, if the user doesn't select any image, how do I assign a default image during save (probably stored in the server)?
if (!user.photo)
user.photo= ?;
user.save();
The one-hack that I can think of is upload the default image and see which UID "Play" stores in the /tmp directory and assign that above. Is there an elegant named* solution to this?
when I say named, I mean I want the code to look like (which means I know what I'm doing and I can also write elegant automated code if there are more than one picture)
user.photo= "images/default/male.jpg"
rather than (which means I'm just hacking and I can't extend it elegantly for a list of pictures)
user.photo= "c0109891-8c9f-4b8e-a533-62341e713a21"
Thanks in advance
The approach I have always taken is to not change the model for empty images, but instead do something in the view to show a default image, if the image does not exist. This I think is a better approach because your are corrupting your model for display purposes, which is bad practice (as you may want to be able to see all those who have not selected an image, for example).
To achieve this, in your view you can simply use the exists() method on the Blob field. The code would look like
#{if user.photo.exists()}
<img src="#{userPhoto(user.id)}">
#{/if}
#{else}
<img src="#{'public/images/defaultUserImage.jpg'}">
#{/else}
I have assumed in the above code that you are rendering the image using the action userPhoto as described in the Lunatech article.
I'd assume you can store the default image somewhere in your applications source folder and use
user.photo.set(new FileInputStream(photo), MimeTypes.getContentType(photo.getName()));
to save the data. Photo is just a File object, so you can get the reference of your default image and use it.