<?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: Changing material parameter via UI in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264105#M6693</link>
    <description>The point is what You are going to achieve.&lt;BR /&gt;
&lt;BR /&gt;
In the libraries I prepared in most cases, due to users wish, I implemented a switch that was responsible for switching the internal surface and the user selectable one. The internal materials' list must be made in Parameter script and then placed as UI_INFIELD - the pic menu can be made with single files (You can use the same pics as the textures, but if it would be better to resize and make special pisc for that usage - I hate the matrix pictures because the unneded effort must be made to prepare such)&lt;BR /&gt;
&lt;BR /&gt;
The both UI_infield's for the project surfaces and the internal ones can be placed in the same place in the UI...but the switch have to be handy somewhere to select the proper set.&lt;BR /&gt;
&lt;BR /&gt;
The example of the UI for internal surface selector:&lt;BR /&gt;
&lt;BR /&gt;
	ui_infield{3} "materialx", xx,yy, dim_x,dim_y,&lt;BR /&gt;
	2,"",12,2,&lt;BR /&gt;
	30,30,29,29,&lt;BR /&gt;
	 "mat1_m.jpg", "MAT1-description", "MAT1",&lt;BR /&gt;
	"mat2_m.jpg","MAT2-description","MAT2"&lt;BR /&gt;
&lt;BR /&gt;
the pix dimensions in this case are 29x29 pixels + 1 pixel extra as the frame in both directions&lt;BR /&gt;
2 means the way the button works, "" means that there wil not be the "matrix" bitmap, next 2 (12,2) may be left alone with any value if not the matrix bitmap is used, but the individual ones.&lt;BR /&gt;
&lt;BR /&gt;
of course the parameters script must contain:&lt;BR /&gt;
&lt;BR /&gt;
VALUES "materialx" "MAT1", "MAT2" ....&lt;BR /&gt;
&lt;BR /&gt;
and the "materialx" parameter type is string.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Piotr</description>
    <pubDate>Thu, 23 Feb 2017 10:36:13 GMT</pubDate>
    <dc:creator>Piotr Dobrowolski</dc:creator>
    <dc:date>2017-02-23T10:36:13Z</dc:date>
    <item>
      <title>Changing material parameter via UI</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264104#M6692</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi guys.&lt;BR /&gt;
&lt;BR /&gt;
It feels like I´m very close, but I´v been stuck for a while now, hope someone can give me a clue!...&lt;BR /&gt;
&lt;BR /&gt;
Im trying to create a single UI page from which predefined materials/surfaces can be chosen. &lt;BR /&gt;
&lt;BR /&gt;
However with a surface parameter placed in a UI_INFIELD code, I can only make it choose between the surfaces from the indexed library.&lt;BR /&gt;
&lt;BR /&gt;
If using a integer parameter in the UI script, I can´t make it control my surface parameter without getting this error: &lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;" possibly unwanted parameter change at line... "&lt;E&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
I created surfaces in the MasterScript via "Define Material" but It seems I can´t make the surface/material parameter choose anything but a numeric value, hence the indexed library surfaces...&lt;BR /&gt;
&lt;BR /&gt;
I´ve tried some overwriting in the Parameter script, but nothing worked so far.   &lt;BR /&gt;
&lt;BR /&gt;
Here´s the UI code with the "testp1" parameters as an integer:&lt;BR /&gt;
&lt;BR /&gt;
ui_infield "testp1",20,60,310,70,&lt;BR /&gt;
1,"4c400x100",4,1,&lt;BR /&gt;
70,70,40,40,&lt;BR /&gt;
&lt;BR /&gt;
1,"Red",&lt;BR /&gt;
2,"Yellow",&lt;BR /&gt;
3,"Blue",&lt;BR /&gt;
4,"Green"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
And the Parameter script:&lt;BR /&gt;
&lt;BR /&gt;
values "testp1" 1,2,3,4&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PARAMETERS mat= testp1&lt;BR /&gt;
IF mat=1 THEN &lt;BR /&gt;
mat1= "Red"&lt;BR /&gt;
ENDIF&lt;BR /&gt;
IF mat=2 THEN &lt;BR /&gt;
mat1= "Yellow"&lt;BR /&gt;
ENDIF&lt;BR /&gt;
IF mat=3 THEN &lt;BR /&gt;
mat1= "Blue"&lt;BR /&gt;
ENDIF&lt;BR /&gt;
IF mat=4 THEN &lt;BR /&gt;
mat1= "Green"&lt;BR /&gt;
ENDIF&lt;BR /&gt;
&lt;BR /&gt;
!PARAMETERS mat1=mat1&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Any tips, help or guidance will be highly appreciated...&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:24:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264104#M6692</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-22T20:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing material parameter via UI</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264105#M6693</link>
      <description>The point is what You are going to achieve.&lt;BR /&gt;
&lt;BR /&gt;
In the libraries I prepared in most cases, due to users wish, I implemented a switch that was responsible for switching the internal surface and the user selectable one. The internal materials' list must be made in Parameter script and then placed as UI_INFIELD - the pic menu can be made with single files (You can use the same pics as the textures, but if it would be better to resize and make special pisc for that usage - I hate the matrix pictures because the unneded effort must be made to prepare such)&lt;BR /&gt;
&lt;BR /&gt;
The both UI_infield's for the project surfaces and the internal ones can be placed in the same place in the UI...but the switch have to be handy somewhere to select the proper set.&lt;BR /&gt;
&lt;BR /&gt;
The example of the UI for internal surface selector:&lt;BR /&gt;
&lt;BR /&gt;
	ui_infield{3} "materialx", xx,yy, dim_x,dim_y,&lt;BR /&gt;
	2,"",12,2,&lt;BR /&gt;
	30,30,29,29,&lt;BR /&gt;
	 "mat1_m.jpg", "MAT1-description", "MAT1",&lt;BR /&gt;
	"mat2_m.jpg","MAT2-description","MAT2"&lt;BR /&gt;
&lt;BR /&gt;
the pix dimensions in this case are 29x29 pixels + 1 pixel extra as the frame in both directions&lt;BR /&gt;
2 means the way the button works, "" means that there wil not be the "matrix" bitmap, next 2 (12,2) may be left alone with any value if not the matrix bitmap is used, but the individual ones.&lt;BR /&gt;
&lt;BR /&gt;
of course the parameters script must contain:&lt;BR /&gt;
&lt;BR /&gt;
VALUES "materialx" "MAT1", "MAT2" ....&lt;BR /&gt;
&lt;BR /&gt;
and the "materialx" parameter type is string.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Piotr</description>
      <pubDate>Thu, 23 Feb 2017 10:36:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264105#M6693</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2017-02-23T10:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing material parameter via UI</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264106#M6694</link>
      <description>Hi Piotr.&lt;BR /&gt;
&lt;BR /&gt;
Thx. for your reply...&lt;BR /&gt;
&lt;BR /&gt;
I made work by using the UI_infield{3}&lt;BR /&gt;
&lt;BR /&gt;
Thank you...</description>
      <pubDate>Thu, 23 Feb 2017 12:07:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Changing-material-parameter-via-UI/m-p/264106#M6694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-23T12:07:54Z</dc:date>
    </item>
  </channel>
</rss>

