how do I pass a vector pointer to MItMeshPolygon.getNormal in Python 1.0 ?
MScriptUtil doesn't have support for vector amirite? Tried with a list,
tried initialized to None...
Also would like to know how many of you are using Python API 2.o ?
--
You received this message because you are
Ok, so after asking I plugged away and figured out how to do it. Here is
what I found for anyone else who is interested in doing this.
def getAttrPlug(nodeName, attrName):
selectionList = OpenMaya.MSelectionList()
try:
selectionList.add(nodeName)
except:
return None
Hi all,
So I have a custom data type that I create in cpp that I use for an
attribute on a custom node. My custom data type is pretty straight forward:
class BlindData : public MPxData
{
public:
BlindData();
virtual ~BlindData();
/**
* Copy the local data from a similar data
I am not 100% sure on windows, but I will make a guess. It might be because
when you are using a pipe you are having the child inherit the file
descriptor (regardless of whether close_fds is used or works on windows).
The child process is looping and writing on stdout (the inherited fd). When
the
Here’s another one I fully expected to work; replacing PIPE with a regular
file.
import subprocessimport threadingimport tempfile
child = """\
import time
while True:
time.sleep(1)
print("child: Still running..")
"""
pipe = tempfile.TemporaryFile()
popen = subprocess.Popen(
It's common when doing multiprocessing to have things working when they
shouldn't in theory (I remember stumbling on a few such examples on
StackOverflow, and writing many myself). This can be due to the order in
which operations are being executed on either processes, the size of the
That sounds logical, but the theory doesn't hold when considering it works
with Python standalone and with Houdini. :(
--
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
If I am not mistaken, when a parent process is trying to exit normally,
that is with no exception or such forced termination, then it needs to wait
for all of its child processes to be joined. If one of them is blocked,
then it won't join.
On 23 February 2017 at 00:13, Marcus Ottosson
Ok, I might have found a way to break this down further.
This also freezes Maya on exit, until I close the new console window.
import subprocessimport threading
child = """\
import time
while True:
time.sleep(1)
print("child: Still running..")
"""
popen = subprocess.Popen(
Thanks Christopher.
Maybe readline() is one of these, meaning that it won’t return until it
receives something, which might never happen in your case after exiting
Maya?
That’s right, readline() blocks until something is passed, via send() in
this case. The for line in iter(out.readline, b""):
Disclaimer: this might be totally unrelated to your problem! :)
A common source of deadlocks when using the `multiprocessing` module (or
anything related to IPC) comes from calling receiving/sending functions
that are blocking. Maybe `readline()` is one of these, meaning that it
won't return
close_fds isn’t supported on Windows apparently.
# ValueError: close_fds is not supported on Windows platforms if you
redirect stdin/stdout/stderr #
DETACHED_PROCESS didn’t work either unfortunately, but it was worth a shot.
I feel it must be related to this somehow. I’ve tried CREATE_NO_WINDOW
Thanks Alok, I did experiment with both of those. Will try this again next.
On 22 Feb 2017 11:30, "Alok Gandhi" wrote:
> And for completeness also pass creationflags=DETACHED_PROCESS in Popen().
>
> On Wed, Feb 22, 2017 at 7:28 PM, Alok Gandhi
And for completeness also pass creationflags=DETACHED_PROCESS in Popen().
On Wed, Feb 22, 2017 at 7:28 PM, Alok Gandhi
wrote:
> Hi Marcus,
>
> I am not sure if this will surely help, but you can set `close_fds=True`
> in subprocess.Popen(). This ensures the
Just to be clear, the problem is leaving this subprocess open (you'll get a
new terminal window appear) when trying to close down Maya. Doing so causes
Maya to hang.
On 22 February 2017 at 10:08, Marcus Ottosson
wrote:
> Hi all,
>
> I’m struggling to understand why my
Hi all,
I’m struggling to understand why my Maya session deadlocks when leaving a
subprocess open whilst listening to its stdout in a thread.
The thread is deamonised, and without the thread then closing down Maya
works well.
I’ve narrowed down the problem into this.
import sysimport
16 matches
Mail list logo