In my model I have a image (SketchUp::Image). When I export the image in obj, a jpg file is created with the name bild3.jpg. How do I access the name "bild3" within a ruby plugin given that I already have access to the image?
Latest posts made by dvonhausen
-
Get Name of Image
-
Access Opacity
I have a component that has a color associated with it. when I have it selected and open "Entity Info" on it then click on the color, a "Choose Paint" panel opens and I can edit the Opacity (set it between 0 and 100). I want to access this value in ruby. I can get the colors for example: "ent.material.color.red". But "ent.material.color.alpha" always returns 1 and not the color of the opacity. Clearly it is stored somewhere but I do I get this opacity value?
Thanks in advance,
Dave -
Group from Selected Entities
This is probably covered in the past but how, using ruby, do I group all of the selected components? In other words, programmatically perform a "Make Group"?
-
RE: [Plugin]ToolsInDialog
Nice tool display. It incorporates something I am trying to do in ruby. When I have several entities selected, how can I create a group of the selected entities? I know how to do it with this tool but how do I push the "Make Group" button programmatically using a ruby plugin? Can't find a send_action that works. ToolsInDialog appears to be doing it in the code somewhere.
-
PolygonMesh behavior
I am writing an obj exporter. I notice that the normals for each vertice from PolygonMesh is different depending on whether I first run Google's obj exporter using:
"Sketchup::active_model.export(objFileName,false)"If I run my exporter without running Google's exporter, the normal for all the vertices of a face from PolygonMesh are the same which is just the normal for the face itself producing a faceted render.
However, if I run my exporter after running Google's exporter on the same object, the normal for all the vertices of any face from PolygonMesh are different producing a smooth face. This tells me that Google's exporter takes into account smooth edges that are connected to a vertice when computing a normal for a vertice and stores it somewhere that PolygonMesh can assess but there is nothing in the doc to suggest this.
Does anyone know why this is and where are the normals for vertices stored when exporting? Any doc or examples?
Thanks
-
Get Default Material
How do I get the default material for a model for the front and back of faces that don't have materials assigned?
-
RE: Question about dynamic component
I would like to know how to create a DC completely from scratch using Ruby. In my case I want to create a sphere with a "radius" attribute. I know how to create dc using SU and accessing the component to add custom attributes and I know how to create a sphere component by creating faces but I don't know how to make it a dc. I assume all I have to do is do a bunch of "set_attributes("dynamic_attributes"..." to make the sphere component dynamic but I don't know what attributes I need to set. Does anyone know?
-
RE: Why don't more people use SketchUp to place 3D components?
If I am going to buy an appliance (or something else), why would I go to my computer to view them before going out to Maytag where I could see the real thing. Thats just more work for me. Manufactures and retailers are not going to invest the time and expense to build components in SU unless they feel it will convert prospects into sales.
If I view 3D sketchup components and have a list of retailers who sell the component sorted in order of how close they are to me and then push a button selecting the retailer which makes a call over my computer to the retailer so I can ask all my questions about the component without every leaving my home, then there begins to be some added value. I also may want to buy it without going to the store so with a push of a button, the retailer has all the info needed to write up the order saving me time. I also have to believe that what I see on the screen is an accurate representation of what I will be buying. For a washing machine, color may be important to me so I want to see the available colors from each retailer and it must be accurately displayed on my screen so I can judge confidently. For clothes, forget it for atleast 10 years. There also has to be a critical mass so I get a large selection and I don't feel that I am missing out on a bargain some place else. Price comparisons will also be a plus. Having components displayed in virtual showrooms that I can customize to reflect my surrounds may be helpful so I can build a room at a time instead of an appliance at a time.
Dave