<?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 [API] Is it possible to make a dependent node without any input ports to get information directly from Maya? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/api-is-it-possible-to-make-a-dependent-node-without-any-input/m-p/11181990#M2497</link>
    <description>&lt;P&gt;Is it possible to make a dependent node without any input ports to get information directly from Maya?&lt;BR /&gt;like getting the timeline length from Maya. if the length is changed, the node can be updated automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I make some changes to my custom convert data node. however, the compute() part doesn't seem to be running.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class GetTimelineRangeNode(om.MPxNode):
    TYPE_NAME = "GetTimelineRange"
    TYPE_ID = om.MTypeId(0x0007F7FB)

    start_frame = None # timeline range start
    end_frame = None
    
    def __init__(self):
        super().__init__()
    
    def compute(self, plug, data):
        if plug == GetTimelineRangeNode.start_frame or plug == GetTimelineRangeNode.end_frame:
            
            max_data_handle = data.outputValue(GetTimelineRangeNode.end_frame)
            max_data_handle.setFloat(oma.MAnimControl.maxTime().value) # getting timeline range, return MTime.
            
            min_data_handle = data.outputValue(GetTimelineRangeNode.start_frame)
            min_data_handle.setFloat(oma.MAnimControl.minTime().value)
            
            data.setClean(plug)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2022 09:29:18 GMT</pubDate>
    <dc:creator>g2m.agent</dc:creator>
    <dc:date>2022-05-20T09:29:18Z</dc:date>
    <item>
      <title>[API] Is it possible to make a dependent node without any input ports to get information directly from Maya?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/api-is-it-possible-to-make-a-dependent-node-without-any-input/m-p/11181990#M2497</link>
      <description>&lt;P&gt;Is it possible to make a dependent node without any input ports to get information directly from Maya?&lt;BR /&gt;like getting the timeline length from Maya. if the length is changed, the node can be updated automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I make some changes to my custom convert data node. however, the compute() part doesn't seem to be running.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;class GetTimelineRangeNode(om.MPxNode):
    TYPE_NAME = "GetTimelineRange"
    TYPE_ID = om.MTypeId(0x0007F7FB)

    start_frame = None # timeline range start
    end_frame = None
    
    def __init__(self):
        super().__init__()
    
    def compute(self, plug, data):
        if plug == GetTimelineRangeNode.start_frame or plug == GetTimelineRangeNode.end_frame:
            
            max_data_handle = data.outputValue(GetTimelineRangeNode.end_frame)
            max_data_handle.setFloat(oma.MAnimControl.maxTime().value) # getting timeline range, return MTime.
            
            min_data_handle = data.outputValue(GetTimelineRangeNode.start_frame)
            min_data_handle.setFloat(oma.MAnimControl.minTime().value)
            
            data.setClean(plug)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 09:29:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/api-is-it-possible-to-make-a-dependent-node-without-any-input/m-p/11181990#M2497</guid>
      <dc:creator>g2m.agent</dc:creator>
      <dc:date>2022-05-20T09:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: [API] Is it possible to make a dependent node without any input ports to get information directly from Maya?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/api-is-it-possible-to-make-a-dependent-node-without-any-input/m-p/11182128#M2498</link>
      <description>&lt;P&gt;If you just want the playback range you can use the scriptJob command to be notifed of that. (using the&amp;nbsp;playbackRangeChanged event)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://help.autodesk.com/cloudhelp/2023/ENU/Maya-Tech-Docs/Commands/scriptJob.html" target="_blank"&gt;https://help.autodesk.com/cloudhelp/2023/ENU/Maya-Tech-Docs/Commands/scriptJob.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 10:23:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/api-is-it-possible-to-make-a-dependent-node-without-any-input/m-p/11182128#M2498</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2022-05-20T10:23:21Z</dc:date>
    </item>
  </channel>
</rss>

