External documentation about Maya API calls

Excuse me, I am trying to write a Maya custom nodes, I try to use “typedAttr. SetUsedAsFilename” to create the file after the specified path, what I need to get him inside of Numbers.
Can someone tell me where to look for cases, or can someone tell me what commands I can use to implement, the Maya documentation is not very friendly for me as a beginner

Now I can only input of the file path. Later, I want to save the values in the file into an array. but I can’t understand the Maya Examples one week .

setUsedAsFilename() is just a way to mark a string attribute as being a file path so that the Maya GUI will allow you to use a file browser to populate the string attribute. It does not do any actual file import or export. You have to do that manually.

Maybe I’m asking a stupid question :sweat_smile:, but I’ve been looking Maya API, how can I implement an input file path of a Maya node so that Maya can read files from that file path.
I’m sorry to disturb you. Is there any relevant example with explanation? Maya [readASCII] Examples can’t understand,May be I got the route wrong. :sob:

Perhaps you should explain from a higher level what you are trying to do. If it is something you can do within maya interactively, take a look at the script editor and it will show you the commands that are executed to carry it out.

I’m trying to put some array or matrix of coordinates into TXT, and then call it from the node that I wrote.
I would appreciate it if you could tell me what features I need to use or provide links to some tutorials :slightly_smiling_face:

Maya will not write or read to a generic txt file, that is something you have to do just using generic python. You might want to look into using the json file format since it is more structured than a txt file. Once you have read in the coordinates from a json file then you can use the Maya API to assign the coordinates to the transform or whatever you are trying to do.

As you said, I said TXT because I don’t know about it. If possible, I would like to call JSON. My current solution is to create more than 1800 matrix inputs on nodes, but this is only temporary and not smart, but I can do it only .So I’m still looking for cases

I agree with mje11eve, you will probably want to use a structured format like JSON. If you are looking to cache matrix data to a file and then read it later, I would recommend just using a Python script or the Python API instead of creating a C++ node. Otherwise you will likely need to find JSON library for C++ and add it to your project. Depends on what you are trying to do.

Thanks so much, I also prefer python, but I also don’t have a good learning case for py writing node, because I found example C++ cases in Youtoube, so I chose it. We education relatively little for node development and programming in Maya
where to go I can to learn more about the Maya API

Maya official example can’t understand :sob:

If you want to stick with c++, it’s not too hard to write out to a txt file. And while json will be nicer, txt is probably sufficient. Just search for “c++ read and write floating point numbers to a file” or something similar.

This might be useful,

https://help.autodesk.com/view/MAYAUL/2022/ENU/?guid=Maya_SDK_py_ref_python_2api1_2py1_custom_node_file_translator_8py_example_html

40 # DESCRIPTION:
   41 #
   42 # Produces the file translator "spCustomNodeTranslator".
   43 #
   44 # This example implements a simple input and output file translator. The writer
   45 # functionality of the translator searches the Maya scene for proxy nodes and
   46 # writes out the name information to the file. The reader functionality of the
   47 # translator simply reads the file in and displays each line.
   48 #
   49 # To use this file translator, first load the plug-in, then create some proxy nodes
   50 # such as spSineNode. Then, use File > Export All to save the proxy node information
   51 # by selecting the "Files of Type" option "spCustomNodeTranslator".
   52 #
   53 # You can select File > Import to read the information back in. When the file is read
   54 # back in, output will be sent to the History panel of the Script Editor.

I don’t know C++ and only use mel or python to write some simple and practical scripts, I don’t want to use C++ either. The key follow-up trouble lies in the nodes of UE4, so I am reluctantly adapting to C++, and the final effect is presented in UE4. If it’s just maya, I’ve already implemented it in the expression

Thank you, I have recently been considering whether to use python to stop at maya, but if it can’t be used in UE4. I used mel to make a set of Rig, and I can’t to synchronize with the face through UE4 :sob:

This topic was automatically closed after 30 days. New replies are no longer allowed.