Possible to make a node to scale render resolution?

Vexus related Support Questions

Possible to make a node to scale render resolution?

Postby DPS » Fri Aug 09, 2019 3:59 am

Say I want to render a low resolution of each of my shots - they’re all different aspect ratios. It would be great to be able to have a multiplier node to handle the scaling rather than manually calculating and setting resolution on a different node.
DPS
 
Posts: 4
Joined: Fri Aug 09, 2019 3:55 am

Re: Possible to make a node to scale render resolution?

Postby DPS » Fri Aug 09, 2019 7:51 am

<?xml version="1.0" encoding="UTF-8"?>
<graph uuid="12345239458-23985-239">
<metadata source="L:/10 - Vexus/sharedtemplates/OUTPUT_MULTIPLIER.vx" appversion="3.10D"/>
<tokens>
<token key="OUTPUT_MULTIPLIER" value=".6"/>
</tokens>
<notes>
<node isExpanded="False" action="default" backgroundColor="RGBA(255,255,0,128)" virtualName="Note" enabled="True" className="Note" zValue="13" id="5" type="note">
<viewblocks isExpanded="False">
<rect y="120.0000000000001" height="27" width="327" x="200"/>
</viewblocks>
<attributeblocks isExpanded="0">
<attributeblock isExpanded="True" action="unknown" name="Parameters">
<attribute action="default" key="font_color" enabled="True" value="RGBA(255,255,255,255)" type="color" label="Font Color"/>
<attribute action="default" decimals="4" key="font_size" enabled="True" value="12" type="float" minValue="1" label="Font Size" maxValue="72"/>
<attribute action="default" method="" key="note" enabled="True" value="Create a token called: OUTPUT_MULTIPLIER" type="textbox" label="Note"/>
</attributeblock>
</attributeblocks>
</node>
</notes>
<containers>
<node isExpanded="True" action="default" backgroundColor="RGBA(255,255,200,50)" image="groupbox.svg" virtualName="Groupbox" enabled="True" className="Groupbox" zValue="-11" id="2" type="container">
<viewblocks isExpanded="False">
<rect y="200" height="250" width="370" x="362"/>
</viewblocks>
<attributeblocks isExpanded="0">
<attributeblock isExpanded="True" action="unknown" name="Parameters">
<attribute action="default" method="" key="groupboxnote" enabled="True" value="" type="string" label="Note"/>
</attributeblock>
</attributeblocks>
</node>
</containers>
<nodes>
<node isExpanded="False" action="default" backgroundColor="RGBA(120,70,215,200)" image="script.svg" virtualName="OUTPUT_MULTIPLIER" enabled="True" className="MaxscriptSnippet" zValue="11" id="1" type="simplenode">
<viewblocks isExpanded="False">
<rect y="220" height="65" width="115" x="448.9505577848959"/>
</viewblocks>
<attributeblocks isExpanded="0">
<attributeblock isExpanded="True" action="mxs_snippet" name="Parameters">
<attribute action="default" key="selectInputNodes" enabled="True" value="False" type="boolean" label="Select Input Nodes"/>
<separator/>
<attribute action="default" method="" key="maxscript" enabled="True" value="renderWidth = (print renderWidth*$$OUTPUT_MULTIPLIER)&#xa;renderHeight = (print renderHeight*$$OUTPUT_MULTIPLIER)" type="textbox" label="Code"/>
<separator/>
<attribute action="default" key="outputSelectedNodes" enabled="True" value="False" type="boolean" label="Output Node Selection"/>
</attributeblock>
</attributeblocks>
<inputs>
<item limit="0" type="data" name=""/>
</inputs>
<outputs>
<item limit="0" type="data" name=""/>
</outputs>
</node>
<node isExpanded="False" action="default" backgroundColor="RGBA(220,75,55,200)" image="settings.svg" virtualName="Resolution" enabled="True" className="Resolution" zValue="12" id="2" type="simplenode">
<viewblocks isExpanded="False">
<rect y="220" height="65" width="85" x="300"/>
</viewblocks>
<attributeblocks isExpanded="1">
<attributeblock isExpanded="True" action="global" name="Parameters">
<attribute action="default" key="setRendApertureWidth" enabled="True" value="36.0" type="float" minValue="0.001" label="Aperture Width (mm)" maxValue="1000"/>
<separator/>
<attribute action="default" key="renderPixelAspect" enabled="True" value="1.0" type="float" minValue="0.001" label="Pixel Aspect" maxValue="1000"/>
<separator/>
<attribute action="default" key="renderWidth" enabled="True" value="1200" type="integer" minValue="1" label="Render Width (px)" maxValue="32768"/>
<attribute action="default" key="renderHeight" enabled="True" value="800" type="integer" minValue="1" label="Render Height (px)" maxValue="32768"/>
</attributeblock>
</attributeblocks>
<inputs>
<item limit="0" type="data" name=""/>
</inputs>
<outputs>
<item limit="0" type="data" name=""/>
</outputs>
</node>
</nodes>
<connections>
<connection childport="3" parentport="2" parentnode="1" childnode="2"/>
</connections>
<submissions default_pre_script="" default_post_script="" default_submit_script="C:/Program Files/Vexus/Samples/mxs/vexus_submitter.ms"/>
</graph>
DPS
 
Posts: 4
Joined: Fri Aug 09, 2019 3:55 am

Re: Possible to make a node to scale render resolution?

Postby boomer » Fri Aug 09, 2019 7:58 am

Well done! We'll work on a similar version with a UI and post it. Note that you don't need the "print" in your MXS lines, this will do instead:
renderWidth = renderWidth*$$OUTPUT_MULTIPLIER
renderHeight = renderHeight*$$OUTPUT_MULTIPLIER
boomer
Site Admin
 
Posts: 237
Joined: Fri Aug 11, 2006 9:03 pm

Re: Possible to make a node to scale render resolution?

Postby DPS » Fri Aug 09, 2019 3:54 pm

Thanks, I've updated mine. I'm trying to make it more complex but having a few issues.

Here it is so far, ideally I want the ability to set the longest dimension to a predetermined resolution:

renderWidth = $$WIREFRAME_RES
renderHeight = $$WIREFRAME_RES/rendImageAspectRatio

but I think it's getting messed up by order or operations.

Tokens
PRODUCTION_RES (5000)
WIREFRAME_RES (1200)
THUMBNAIL_RES (900)

Also a couple more related questions:

- Would there be a way to make a token that sets another token, or I could have a separate node per whichever render output I need and then manually disable each but ideally I'd have a button that calls one of the above tokens.
- Is there a way to pull values from max? So I could quickly pull for example resolution from max to your resolution node.

To give you the background story:
Lets say I have a project with 15 shots, and I need to provide the client with 2-3 options per shot, plus I'll render several that don't make the cut, and two versions of each (1200 pixels & 900 pixels). That's around 60-90 renders with different aspect ratios, some landscape, some portrait.
DPS
 
Posts: 4
Joined: Fri Aug 09, 2019 3:55 am

Re: Possible to make a node to scale render resolution?

Postby boomer » Sat Aug 10, 2019 11:45 am

David,

Regarding setting resolution, when you change the width or height, the aspect ratio is updated in MAX. To solve this, you should set the height first. For example:

renderHeight = $$RES / rendImageAspectRatio
renderWidth = $$RES

Regarding your other question, take a look at the Maxscript Token node. It lets you evaluate values/settings in MAX and set a token with the return value. That should get the job done.

Cheers,
Mathew Kaustinen
Boomer Labs
boomer
Site Admin
 
Posts: 237
Joined: Fri Aug 11, 2006 9:03 pm


Return to Vexus

Who is online

Users browsing this forum: No registered users and 3 guests

cron