<?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: Object to lamp in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191908#M23926</link>
    <description>Thanks Karl. That's what I thought I should do to do but wasn't sure a light was a lamp in that dialog. Even if I had gone ahead and done it I wouldn't have known I needed to do the GDL part.</description>
    <pubDate>Fri, 18 Sep 2009 18:24:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-09-18T18:24:31Z</dc:date>
    <item>
      <title>Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191905#M23923</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;If I have a regular object I made or downloaded, how can I save it as a lamp object?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Sep 2009 17:59:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191905#M23923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-18T17:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191906#M23924</link>
      <description>&lt;BLOCKQUOTE&gt;Wrathchild wrote:&lt;BR /&gt;If I have a regular object I made or downloaded, how can I save it as a lamp object?&lt;/BLOCKQUOTE&gt;

Open the object and change its subtype to "Light" (US library) as seen in the attached screenshot.&lt;BR /&gt;
&lt;BR /&gt;
Then...&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/37423iD64DCC3F44E930D8/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Change Subtype.png" title="Change Subtype.png" /&gt;</description>
      <pubDate>Fri, 18 Sep 2009 18:09:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191906#M23924</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-09-18T18:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191907#M23925</link>
      <description>That makes a couple of things happen.  One, the being now of the Lamp subtype, the object will be placed with the Lamp tool and not the generic Object tool.  Two, additional lighting related parameters are added as seen in the attached screenshot - to turn the lamp on/off, change its color and intensity.&lt;BR /&gt;
&lt;BR /&gt;
Note that these new parameters will not do anything though unless you modify the GDL code to include a lamp to emit light, tied to those parameters.&lt;BR /&gt;
&lt;BR /&gt;
In the screenshot, I've turned a bean-bag chair into a lamp object, but it is still just a bean-bag chair.&lt;BR /&gt;
&lt;BR /&gt;
Easiest thing for the GDL code is to just copy a snippet from an existing lamp object in the library.  Getting the lamp aimed in the right direction could be the most challenging part.&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Karl&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/37406i529BECA96624E7B3/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Now a Lamp.png" title="Now a Lamp.png" /&gt;</description>
      <pubDate>Fri, 18 Sep 2009 18:12:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191907#M23925</guid>
      <dc:creator>Karl Ottenstein</dc:creator>
      <dc:date>2009-09-18T18:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191908#M23926</link>
      <description>Thanks Karl. That's what I thought I should do to do but wasn't sure a light was a lamp in that dialog. Even if I had gone ahead and done it I wouldn't have known I needed to do the GDL part.</description>
      <pubDate>Fri, 18 Sep 2009 18:24:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191908#M23926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-18T18:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191909#M23927</link>
      <description>I got all that working pretty good but when I choose a color for the light the only palette I get is the one w/ the crayons. What should I do to fix it to get all the palettes?</description>
      <pubDate>Fri, 18 Sep 2009 19:02:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191909#M23927</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-18T19:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191910#M23928</link>
      <description>Never mind. I got it.</description>
      <pubDate>Fri, 18 Sep 2009 19:12:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191910#M23928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-18T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191911#M23929</link>
      <description>Got another problem.&lt;BR /&gt;
&lt;BR /&gt;
The light sphere is located at the bottom of my light fixture. I would like it to be in the middle.&lt;BR /&gt;
&lt;BR /&gt;
I copied the script from a general light which has a parameter of slc for the showing the light sphere.&lt;BR /&gt;
&lt;BR /&gt;
Do one of these numbers control where the light sphere is located?&lt;BR /&gt;
&lt;BR /&gt;
If slc Then&lt;BR /&gt;
	For i=1 To 4&lt;BR /&gt;
		hotspot 0,0,0,unID,dist1,1+128 : unID=unID+1&lt;BR /&gt;
		hotspot 0,-1,0,unID,dist1,3 : unID=unID+1&lt;BR /&gt;
		hotspot 0,dist1,0,unID,dist1,2 : unID=unID+1&lt;BR /&gt;
&lt;BR /&gt;
		hotspot 0,0,0,unID,dist2,1+128 : unID=unID+1&lt;BR /&gt;
		hotspot 0,-1,0,unID,dist2,3 : unID=unID+1&lt;BR /&gt;
		hotspot 0,dist2,0,unID,dist2,2 : unID=unID+1&lt;BR /&gt;
		rotz 90</description>
      <pubDate>Fri, 18 Sep 2009 19:44:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191911#M23929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-18T19:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191912#M23930</link>
      <description>Wrathchild:&lt;BR /&gt;
&lt;BR /&gt;
The code you posted is for some editable (movable) hotspots, which might be used for allowing the user to move the &lt;FONT color="blue"&gt;light&lt;/FONT&gt; in the model, controlling the parameters &lt;FONT color="red"&gt;dist1&lt;/FONT&gt; and &lt;FONT color="red"&gt;dist2&lt;/FONT&gt;. The &lt;FONT color="blue"&gt;light&lt;/FONT&gt; would need to be transformed (moved) by these same parameters in the 3D Script, or the &lt;FONT color="blue"&gt;light&lt;/FONT&gt; could be moved without them if you don't need this feature. In short, the &lt;FONT color="blue"&gt;light&lt;/FONT&gt; needs to be transformed (moved) within the 3D Script, usually with the &lt;FONT color="blue"&gt;ADD&lt;/FONT&gt; transformation, like any other part of the 3D model. Also, you have shown only part of this subroutine, as the &lt;FONT color="blue"&gt;FOR&lt;/FONT&gt; needs a &lt;FONT color="blue"&gt;NEXT&lt;/FONT&gt; to complete the loop, so there may be other things going on in this part of the script.&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Sat, 19 Sep 2009 12:25:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191912#M23930</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2009-09-19T12:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191913#M23931</link>
      <description>David,&lt;BR /&gt;
&lt;BR /&gt;
Here is the object. I found a line in the master script:  j=slc&lt;BR /&gt;
&lt;BR /&gt;
I thought that might be what I needed to work on with ADD and tried a couple things but nothing happened.&lt;BR /&gt;
&lt;BR /&gt;
Would you mind taking a look and letting me know if this is indeed what I should be looking at and where to put the ADD.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be much appreciated as I'm still not very fluent with GDL and pretty much just muddle along.&lt;BR /&gt;
&lt;BR /&gt;
Rick</description>
      <pubDate>Sat, 19 Sep 2009 18:10:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191913#M23931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-19T18:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191914#M23932</link>
      <description>Rick:&lt;BR /&gt;
&lt;BR /&gt;
[For those who have not looked at his object, it is a .3ds file converted to a .gsm file. The 3D Script with the lantern part is about 2600 lines of code, in addition to the lamp code Rick added, which is about 100 lines of code.]&lt;BR /&gt;
&lt;BR /&gt;
You should treat the code you added as one block or subroutine, add a transformation at the beginning of the code to move the lamp to the desired location within the lantern, then delete that transformation at the end of that code before the lantern code. This is similar to selecting one element within your model and moving it relative to the other parts.&lt;BR /&gt;
&lt;BR /&gt;
So on this case, the start of the code should be:&lt;BR /&gt;
…If C And G Then&lt;BR /&gt;
&lt;BR /&gt;
	&lt;FONT color="red"&gt;AddZ zzyzx*.5		! move light vertically 1/2 the height of the object&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
	DIM colorRGB[3]&lt;BR /&gt;
	colorRGB[1] = D&lt;BR /&gt;
	colorRGB[2] = E&lt;BR /&gt;
	colorRGB[3] = F…&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="blue"&gt;AddZ&lt;/FONT&gt; moves the local origin in the vertical direction, &lt;FONT color="blue"&gt;zzyzx&lt;/FONT&gt; is the height of the object (you can see this parameter in the library part main window), multiplying this by &lt;FONT color="blue"&gt;.5&lt;/FONT&gt; moves the local origin 1/2 the height of the object.&lt;BR /&gt;
&lt;BR /&gt;
And the end of the lamp code should be:&lt;BR /&gt;
&lt;BR /&gt;
	…sphere dist2&lt;BR /&gt;
	model solid&lt;BR /&gt;
EndIf&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT color="red"&gt;Del 1		! delete transformation&lt;/FONT&gt;&lt;BR /&gt;
&lt;BR /&gt;
MUL A/0.2048950, B/0.2048979, zzyzx/0.7640000…&lt;BR /&gt;
&lt;BR /&gt;
The &lt;FONT color="blue"&gt;Del&lt;/FONT&gt; removes the last transformation, in this case your AddZ command, so the local origin is returned to its original location for the rest of the lantern code from the .3ds file.&lt;BR /&gt;
&lt;BR /&gt;
As for the &lt;FONT color="blue"&gt;sic&lt;/FONT&gt; and other parameters, you can look at the main library part window under the Variable column, and read their description in the Name column so you know what they do. In this case the &lt;FONT color="blue"&gt;sic&lt;/FONT&gt; parameter is for controlling the &lt;FONT color="green"&gt;Show Light Sphere&lt;/FONT&gt; parameter under the &lt;B&gt;Light Settings&lt;/B&gt; sub parameter list. This should help you understand what parts of the 3D (and other) Script is for in altering the object.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
&lt;BR /&gt;
David</description>
      <pubDate>Sun, 20 Sep 2009 16:16:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191914#M23932</guid>
      <dc:creator>David Maudlin</dc:creator>
      <dc:date>2009-09-20T16:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Object to lamp</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191915#M23933</link>
      <description>Thank you David for this very good explanation and for taking the time to look at this.&lt;BR /&gt;
&lt;BR /&gt;
Very helpful and very much appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Rick</description>
      <pubDate>Sun, 20 Sep 2009 16:32:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Object-to-lamp/m-p/191915#M23933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-20T16:32:37Z</dc:date>
    </item>
  </channel>
</rss>

