[Maya-Python Club:1790] render sampler in custom node

2009-02-23 Thread wilsimar
hi.. I´m making my first custom node... and after read maya api docs, I have some questions... ... how to get rendering info in my compute function.. like.. current rendering camera position and/or current sampling point position in camera space.? ... mag (vector lenght) mel function exists i

[Maya-Python Club:1791] Re: render sampler in custom node

2009-02-23 Thread Chad Vernon
Attributes just need to have specific naming to pull from the sampler. Special names include: inColor normalCamera tangentUCamera etc. Once you have those attributes, they should just be filled with the relevant data. The api has the MVector class which contains all the vector operations. On Mon

[Maya-Python Club:1792] Re: accessing string data from a datablock

2009-02-23 Thread Matthew Chapman
I don't have a way to test this right now but I was wondering if you could get the MObject of the string data from the dataBlock and pass it to MFnStringData and call MFnStringData.string()? Matt On Sat, Feb 21, 2009 at 7:19 PM, Dean Edmonds wrote: > > On Sat, Feb 21, 2009 at 15:20, John Riddle

[Maya-Python Club:1793] Re: accessing string data from a datablock

2009-02-23 Thread John Riddle
I'm sorry but I'm still very new to the API and can't seem to get the syntax right. I'm doing: dataHandle = dataBlock.inputValue( readBandedImageNode.filename ) filenameStr = dataHandle.asString() and getting filenameStr as an MString object. Dean mentioned above I am going to need use MPlug to g

[Maya-Python Club:1794] Re: MDGContext in python and another question

2009-02-23 Thread barnabas79
Example usage of MDGContext: import maya.OpenMaya as om atTime10 = om.MDGContext(om.MTime(10)) import maya.OpenMaya as om atTime10 = om.MDGContext(om.MTime(10)) selList = om.MSelectionList() selList.add("pCube1.translateX") plug = om.MPlug() selList.getPlug(0, plug) print "Value now: ", plug.asD

[Maya-Python Club:1795] Re: render sampler in custom node

2009-02-23 Thread wilsimar
wow. wonderful.. but where I find the list of automatic filled attributes? thank you very much chad Wilsimar Goiânia - Goiás - Brazil On Feb 23, 2:13 pm, Chad Vernon wrote: > Attributes just need to have specific naming to pull from the sampler. > Special names include: > inColor > normalCame

[Maya-Python Club:1796] Re: accessing string data from a datablock

2009-02-23 Thread Matthew Chapman
Let me know if these are wrong I am not able to test this wight now. # Somthing like this for MPlug I think node = self.thisMObject() plug = api.MPlug(node, readBandedImageNode.filename) strData = plug.asString() # I am wondering if this might work dataHandle = dataBlock.inputValue( readBandedI

[Maya-Python Club:1797] Mesh selection: Only a section of the Complete mesh

2009-02-23 Thread russelltdi...@googlemail.com
Hello, I'm working on a project to create a tool/plug-in that will create and simulate an Asteroid impacting a planetary surface. Part of the effect will be the displacement of the surface the Astral Body impacts with. What I intend to do is to select only the required section of geometry that w

[Maya-Python Club:1798] Re: MDGContext in python and another question

2009-02-23 Thread Todd Widup
Thanks Paul, that is a huge help, I appreciate it cheers -todd On Mon, Feb 23, 2009 at 10:08 AM, barnabas79 wrote: > > Example usage of MDGContext: > > import maya.OpenMaya as om > atTime10 = om.MDGContext(om.MTime(10)) > import maya.OpenMaya as om > atTime10 = om.MDGContext(om.MTime(10)) > > s

[Maya-Python] Re: [Maya-Python Club:1796] Re: accessing string data from a datablock

2009-02-23 Thread John Riddle
The MPlug method that you posted is what works for me. The MFnStringData bit still throws an error. NotImplementedError: No matching function for overloaded 'new_MFnStringData' // But hey, I got a string I can work with! Haha Thanks a lot for your help Matt and Dean. On Mon, Feb 23, 2009 at 10:

[Maya-Python] Re: [Maya-Python Club:1796] Re: accessing string data from a datablock

2009-02-23 Thread Matthew Chapman
would you mind posting what this returns? dataHandle = dataBlock.inputValue( readBandedImageNode.filename ) data = dataHandle.data() print data, type(data) I am wondering what instance is returned from a '.data()' call for a string. Matt On Mon, Feb 23, 2009 at 11:04 AM, John Riddle

[Maya-Python] Re: [Maya-Python Club:1796] Re: accessing string data from a datablock

2009-02-23 Thread John Riddle
Here ya go: On Mon, Feb 23, 2009 at 11:19 AM, Matthew Chapman wrote: > would you mind posting what this returns? > > dataHandle = dataBlock.inputValue( readBandedImageNode.filename ) > data = dataHandle.data() > print data, type(data) > > I am wondering what instance is returned f

[Maya-Python] Re: [Maya-Python Club:1796] Re: accessing string data from a datablock

2009-02-23 Thread Matthew Chapman
I guess I will have to play with it sometime cause I think there is a way to get around the bug using MFnStringData. This way you don't have to use MPlug and make queries directly into the DG. Matt On Mon, Feb 23, 2009 at 11:22 AM, John Riddle wrote: > Here ya go: > _a8d6b90f_p_MObject> > > >

[Maya-Python] Re: [Maya-Python Club:1768] Re: PyMEL 0.9 Release Candidate

2009-02-23 Thread chadrik
Just dropped RC4 which should fix this problem. Does anyone have any feedback regarding the treatment of non-existent objects in the new PyMEL? love it, hate it? check out the docs under non-backward compatible changes. -chad > > Everytime I import pymel in Maya 8.5sp1, I have the foll

[Maya-Python] MImage pixels...

2009-02-23 Thread jbrav...@gmail.com
I'm trying to execute this bit of code I found in one of the devkit examples. (customImagePlane.py) image = OpenMaya.MImage() image.readFromFile(filenameStr) scriptUtil = OpenMaya.MScriptUtil() widthPtr = scriptUtil.asUintPtr() heightPtr = scriptUtil.asUintPtr() scriptUtil.setUint( widthPtr, 0 )

[Maya-Python] Re: MImage pixels...

2009-02-23 Thread Ravi Jagannadhan
Maybe the MScriptUtil class can help you here? It's a python wrapper for pointers/references. On Mon, Feb 23, 2009 at 4:06 PM, jbrav...@gmail.com wrote: > > I'm trying to execute this bit of code I found in one of the devkit > examples. (customImagePlane.py) > > image = OpenMaya.MImage() > image

[Maya-Python] Re: MImage pixels...

2009-02-23 Thread John Riddle
Well that was a healthy rant only to discover that I should be using getUcharArrayItem instead of getCharArrayItem... nice work Riddle... =P On Mon, Feb 23, 2009 at 4:09 PM, Ravi Jagannadhan wrote: > > Maybe the MScriptUtil class can help you here? It's a python wrapper > for pointers/references

[Maya-Python] Custom node with default connections?

2009-02-23 Thread jbrav...@gmail.com
If I were to create a custom node and I wanted it to start with an expression connected to an attribute by default, what is the best way to go about this? Should it be done in the initializer? Somewhere in the beginning of the node class? I have a frame attribute that I want to start with the expr