<?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: How to pass a MaxScript bitmap to C++ using function-publishing in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453362#M9344</link>
    <description>&lt;P&gt;the value version works ok though, you could get it to throw typical max script errors so from the mxs side theres no difference.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Dec 2018 18:07:11 GMT</pubDate>
    <dc:creator>klvnk</dc:creator>
    <dc:date>2018-12-07T18:07:11Z</dc:date>
    <item>
      <title>How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8425729#M9337</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question regarding&amp;nbsp;how to pass a MaxScript bitmap to C++ using function-publishing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the following definition for my function-published interface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt; void SetImage(PBBitmap &amp;amp;bmap);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt; PBBitmap&amp;amp; GetImage();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt; PROP_FNS(IFP_OpenVINO::em_getBmap, GetImage, IFP_OpenVINO::em_setBmap, SetImage, TYPE_BITMAP_BV)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;And on the MaxScript side I use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;STRONG&gt;myBitmap = openBitmap &amp;lt;some-path to an image&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;STRONG&gt;fp.Image = myBitmap&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;STRONG&gt;showproperties myBitmap&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;STRONG&gt;My expectation is that on the C++ side my GetImage has received by-value a MXS Bitmap object that I can work with.&amp;nbsp; This is not working as I am getting trash.&amp;nbsp; Might anyone be so kind as to pointing me to working samples or how-tos that demonstrate proper usage of function-publishing and bitmaps?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 20:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8425729#M9337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-26T20:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8425888#M9338</link>
      <description>&lt;P&gt;not sure, but have you also tried "by reference" instead of "by value"?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 22:14:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8425888#M9338</guid>
      <dc:creator>istan</dc:creator>
      <dc:date>2018-11-26T22:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8428047#M9339</link>
      <description>&lt;P&gt;Greetings Istan -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have approached the problem both ways - taking the Bitmap objects from Maxscript to C++ both by-value and by-reference.&amp;nbsp; In both cases I get clean builds - so no insight from the compiler - and Maxscript seems perfectly happy in passing the Bitmap object to the C++ layer.&amp;nbsp; However, when I set a breakpoint in my C++ getter I am still getting trash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have reviewed the HowTo.sln and specifically the FunctionPublishing project for guidance and that is where I am coming from.&amp;nbsp; What I really would like is a bit of code-sample - either from the samples or from elsewhere - that demonstrate either thru FnPub or through traditional paramblock2 how to pass a Bitmap from MXS to C++ layer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have additional questions ... RudyC&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 18:19:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8428047#M9339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-27T18:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8451474#M9340</link>
      <description>&lt;P&gt;&lt;STRONG&gt;MXS will pass it as a MAXBitMap value not a Bitmap so you could try it as a TYPE_VALUE not TYPE_BITMAP&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;then do something like...&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;void SetImage(Value* val)&lt;BR /&gt;{&lt;BR /&gt;    if(val-&amp;gt;tag == class_tag(MAXBitMap)) //maxscript.h/value.h
    {
         MAXBitMap* maxbitmap = (MAXBitMap*)val;
         Bitmap* bm = maxbitmap-&amp;gt;bm;
         if(bm)......&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 23:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8451474#M9340</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2018-12-06T23:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8451514#M9341</link>
      <description>&lt;P&gt;you could also try is like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;void SetImage(Bitmap *bmap);
Bitmap* GetImage();

PROP_FNS(IFP_OpenVINO::em_getBmap, GetImage, IFP_OpenVINO::em_setBmap, SetImage, TYPE_BITMAP)&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 23:55:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8451514#M9341</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2018-12-06T23:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453322#M9342</link>
      <description>&lt;P&gt;the value version works as expected&lt;/P&gt;
&lt;P&gt;the other method partially...&lt;/P&gt;
&lt;P&gt;though it should be&lt;/P&gt;
&lt;PRE&gt;void SetImage(PBBitmap *bmap);
PBBitmap * GetImage();

PROP_FNS(IFP_OpenVINO::em_getBmap, GetImage, IFP_OpenVINO::em_setBmap, SetImage, TYPE_BITMAP)&lt;/PRE&gt;
&lt;P&gt;unfortunately only the bitmapinfo ptr of the PBBitmap is valid the Bitmap is a null pointer and you can only pass "saved"/loaded bitmaps which is odd though it could be bug in the version i use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 17:50:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453322#M9342</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2018-12-07T17:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453338#M9343</link>
      <description>&lt;P&gt;Thanks klvnk -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried your approach and can see the situation in Max 2019 ... the PBBitmap has data and the ptr to Bitmap is null.&amp;nbsp; It indeed might be a bug.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RudyC&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 17:53:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453338#M9343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-07T17:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a MaxScript bitmap to C++ using function-publishing</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453362#M9344</link>
      <description>&lt;P&gt;the value version works ok though, you could get it to throw typical max script errors so from the mxs side theres no difference.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 18:07:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/how-to-pass-a-maxscript-bitmap-to-c-using-function-publishing/m-p/8453362#M9344</guid>
      <dc:creator>klvnk</dc:creator>
      <dc:date>2018-12-07T18:07:11Z</dc:date>
    </item>
  </channel>
</rss>

