<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: wrapping ramp parameter in Qt interface in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493161#M11028</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking about you are trying to add a maya ramp control into a custom widget window. So it should be displayed first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are adding to a node, i think using nodename with that AE*Ramp command should be all right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 11:43:11 GMT</pubDate>
    <dc:creator>cheng_xi_li</dc:creator>
    <dc:date>2017-10-26T11:43:11Z</dc:date>
    <item>
      <title>wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7491615#M11024</link>
      <description>&lt;P&gt;This code&amp;nbsp;shows my ramp parameter, but if I uncomment out the show line at the end and comment out the "&lt;SPAN&gt;self.w.show()" inside the class definition I get an empty box without the ramp. Basically, &amp;nbsp;can create a ramp parameter but not get it "out" from the class defenition. Is there something wrong with how I define the window?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from PySide.QtCore import *&lt;BR /&gt;from PySide.QtGui import *&lt;BR /&gt;from maya.app.general.mayaMixin import MayaQWidgetBaseMixin&lt;BR /&gt;import pymel.core as pm&lt;BR /&gt;from maya import cmds&lt;BR /&gt;from maya import OpenMayaUI as omui&lt;BR /&gt;import shiboken&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;class dice_objectScatter(MayaQWidgetBaseMixin, QTreeView):&lt;BR /&gt;def __init__(self, parent=None, *args, **kwargs):&lt;BR /&gt;super(dice_objectScatter, self).__init__(*args, **kwargs)&lt;/P&gt;&lt;P&gt;# Destroy this widget when closed. Otherwise it will stay around&lt;BR /&gt;self.setAttribute(Qt.WA_DeleteOnClose, True)&lt;BR /&gt;self.setupUi()&lt;/P&gt;&lt;P&gt;def setupUi(self):&lt;BR /&gt;self.setObjectName("Form")&lt;BR /&gt;self.resize(400, 400)&lt;BR /&gt;self.setWindowTitle("ramp test")&lt;BR /&gt;self.verticalLayout = QVBoxLayout(self)&lt;BR /&gt;self.setLayout(self.verticalLayout)&lt;BR /&gt;self.verticalLayout.setObjectName("mainLayout")&lt;BR /&gt;layout = omui.MQtUtil.fullName(long(shiboken.getCppPointer(self.verticalLayout)[0])) # get maya pointer&lt;BR /&gt;cmds.setParent(layout)&lt;BR /&gt;self.w = QWidget()&lt;BR /&gt;rampWidgetName = "rampWidget3"&lt;BR /&gt;self.w.setObjectName(rampWidgetName)&lt;BR /&gt;self.l = QVBoxLayout(self.w)&lt;BR /&gt;self.l.setObjectName("ramp_layout")&lt;BR /&gt;self.w_ptr = omui.MQtUtil.findWindow(rampWidgetName)&lt;BR /&gt;self.w_name = omui.MQtUtil.fullName(long(self.w_ptr))&lt;BR /&gt;cmds.setParent(self.w_name)&lt;BR /&gt;self.ramp_eval_string = 'source AEaddRampControl; AEmakeLargeRamp("|rampTest1.houdiniAssetParm_ramp__ramp", 0, 0, 0, 0, 0);'&lt;BR /&gt;mel.eval(self.ramp_eval_string)&lt;BR /&gt;self.w.show()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ptr = omui.MQtUtil.mainWindow()&lt;BR /&gt;mainWin = shiboken.wrapInstance(long(ptr), QWidget)&lt;BR /&gt;window = dice_objectScatter()&lt;BR /&gt;#window.show()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 20:26:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7491615#M11024</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-25T20:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7492991#M11025</link>
      <description>&lt;P&gt;Solved. Not sure how, nothing different in my working code. Probably&amp;nbsp;path collision to&amp;nbsp; some old widget.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 10:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7492991#M11025</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T10:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493120#M11026</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are several errors in your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.AE*ramp work with node&lt;/P&gt;
&lt;P&gt;2.You should add ramp after window is created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;gradientControlNoAttr&amp;nbsp;&lt;/SPAN&gt; is the MEL command for creating ramp controls.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an updated version:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;from PySide.QtCore import *
from PySide.QtGui import *
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin
import pymel.core as pm
from maya import cmds
from maya import OpenMayaUI as omui
import shiboken

class dice_objectScatter(MayaQWidgetBaseMixin, QTreeView):
		def __init__(self, parent=None, *args, **kwargs):
				super(dice_objectScatter, self).__init__(*args, **kwargs)
				# Destroy this widget when closed. Otherwise it will stay around
				self.setAttribute(Qt.WA_DeleteOnClose, True)
				self.setupUi()

		def setupUi(self):
				self.setObjectName("Form")
				self.resize(400, 400)
				self.setWindowTitle("ramp test")
				self.verticalLayout = QVBoxLayout()
				self.verticalLayout.setObjectName("mainLayout")

				self.w = QWidget(self)
				rampWidgetName = "rampWidget3"
				self.w.setObjectName(rampWidgetName)
				self.l = QVBoxLayout()
				self.l.setObjectName("ramp_layout")				
				self.w.setLayout(self.l)
				self.w.resize(400,400)
			
				self.verticalLayout.addWidget(self.w)
				self.setLayout(self.verticalLayout)

	
                
 
ptr = omui.MQtUtil.mainWindow()
mainWin = shiboken.wrapInstance(long(ptr), QWidget)
window = dice_objectScatter()
window.show()
&lt;BR /&gt;#Please notice the fullname is not Form|mainLayout|ramp_layout here. Adding a control to desired layout and use MQtUtil::findControl could get you correct path.
cmds.setParent('Form|mainLayout|ramp_layout')
ramp_eval_string = """gradientControlNoAttr -h 90 falloffCurve5;
                    gradientControlNoAttr -e
                   -optionVar "falloffCurveOptionVar"
                   falloffCurve5;""" 
mel.eval(ramp_eval_string)			
				&lt;/PRE&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:26:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493120#M11026</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2017-10-26T11:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493138#M11027</link>
      <description>&lt;P&gt;Nice one!&amp;nbsp;Really appreciate the clean up&amp;nbsp;and style directions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shouldn't I pass the name to the&amp;nbsp;attribute I want to control? What I'm doing here is wrapping an existing node to a custom GUI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How come I have to display them&amp;nbsp;before populating them? Haven't seen anything on this in the docs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:34:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493138#M11027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T11:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493161#M11028</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was thinking about you are trying to add a maya ramp control into a custom widget window. So it should be displayed first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are adding to a node, i think using nodename with that AE*Ramp command should be all right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:43:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493161#M11028</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2017-10-26T11:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493185#M11029</link>
      <description>&lt;P&gt;No you were correct initally, it is for a custom widget but&amp;nbsp;I'm linking it to the&amp;nbsp;node's ramp parameter which I get from this AE command. Not sure if I should skip this intermediate AE&amp;nbsp;step and create a ramp myself and hook it to the node directly?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:47:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493185#M11029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T11:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493222#M11030</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think if you could make AE work it should be simpler, because it should be linked to node already.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually there is an attribute version named just gradientControl. You may also want to check it out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours,&lt;/P&gt;
&lt;P&gt;Li&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:55:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493222#M11030</guid>
      <dc:creator>cheng_xi_li</dc:creator>
      <dc:date>2017-10-26T11:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: wrapping ramp parameter in Qt interface</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493227#M11031</link>
      <description>Will do! Thanks again Li.&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Oct 2017 11:56:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/wrapping-ramp-parameter-in-qt-interface/m-p/7493227#M11031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T11:56:54Z</dc:date>
    </item>
  </channel>
</rss>

