by EarthMover » Sun Sep 20, 2009 2:30 pm
Is it possible by ruby to create a script that can access the edit function of all components on the same layer simultaneously? I am looking to have a script that will activate the "Always Face Camera" option of all components on a given layer. I recently purchased the entire cadplants.com library. This is over 5500 plant components of great quality. Unfortunately none of them are set up to Face the camera. As they are inserted into the scene, each plant is a component assigned to the same layer. If it is possible to activate all on layer to always face camera, it would save me so much time and frustration. I just need a really simple script, or some help with a snippet or two of code.
Thanks kindly!
EDIT - Plugin attached. (thanks Jim!!) I added a file loader and a toolbar button to the script. I will advise the author of the plant library to have his SU customers visit this thread to get the plugin, which is sure to be a time saver.
Please, register (free) to access all the attachments on the forums.
Last edited by thomthom on Tue Dec 08, 2009 9:40 pm, edited 3 times in total.
Reason: Just cleaning up and organizing the Plugin forum. Correcting [Plugin] tag
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller Some of my 3D crap
-

EarthMover
- Top SketchUcator
-
- Posts: 1792
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: Adam Hails
by majid » Sun Sep 20, 2009 3:16 pm
dear mate , there is a trick , but time consuming: open the model go to :window-->model info-->File-->Allignment-->(chek) always face camera then save it so that later could see it obviousely, now if you insert in in another file , it would be a face-camera component.
-

majid
- Top SketchUcator
-
- Posts: 1556
- Joined: Sun Dec 16, 2007 8:51 pm
- Location: Isfahan Iran
- Name: majid
- Operating system: Windows
- SketchUp version: 8
- License type: Free/Make
- SketchUp use: architecture
- Level of SketchUp: Intermediate
-
by Jim » Sun Sep 20, 2009 3:39 pm
Yes, it's possible. Note it should also be possible to batch process components stored on disk.
load this, and type 'layer_face_camera' in the Ruby Console.
[ plugin moved to first post ]
-
Jim
- Global Moderator
-
- Posts: 4126
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: NEOH
- Name: Jim
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Intermediate
-
by EarthMover » Sun Sep 20, 2009 4:23 pm
Thanks so much Jim! (and Majid) The code works great and is exactly what I needed. 
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller Some of my 3D crap
-

EarthMover
- Top SketchUcator
-
- Posts: 1792
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: Adam Hails
by Jim » Mon Sep 21, 2009 2:49 pm
I added support for a single Undo operation - otherwise it could cause a big mess if you change your mind..
I updated the .zip in the first post.
-
Jim
- Global Moderator
-
- Posts: 4126
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: NEOH
- Name: Jim
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Intermediate
-
by EarthMover » Mon Sep 21, 2009 3:01 pm
Thanks Jim...I was just looking through other scripts to try and find the snippet that allowed this. I will study what you did. Thanks for the update.
This script, the plant library, Twilight and RPTools component search tool has turned SU into a super fast and powerful landscape design program for me! I'm really excited about the possibilities.
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller Some of my 3D crap
-

EarthMover
- Top SketchUcator
-
- Posts: 1792
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: Adam Hails
by Jim » Mon Sep 21, 2009 3:43 pm
Just updated again to fix a typo.
-
Jim
- Global Moderator
-
- Posts: 4126
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: NEOH
- Name: Jim
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Intermediate
-
by majid » Mon Sep 21, 2009 4:32 pm
wowww mates...Sketchup progress by you ,ruby scripters is unblievable. thanx mates 
-

majid
- Top SketchUcator
-
- Posts: 1556
- Joined: Sun Dec 16, 2007 8:51 pm
- Location: Isfahan Iran
- Name: majid
- Operating system: Windows
- SketchUp version: 8
- License type: Free/Make
- SketchUp use: architecture
- Level of SketchUp: Intermediate
-
by wahoowetzel » Sun Jan 31, 2010 7:28 am
I'm not sure if this is the best place to pose this question, but I think it may be relevant. If not, sorry.
I'm in the process of doing some renders which may be akin to Earthmover's "couple new pool renders" thread. My question is regarding the actual process of bringing in your own 2D image files in to SU and getting them to face the camera. The cadplants.com examples are great, I would love to understand that workflow to produce my own. But my first couple of tries have led to one random success that I have not been able to repeat, so at this point I would just be happy with a 2d image that faces the camera (even if it's not as easy and nice to use as the cadplants samples that you can switch lowres and hires images in and out and whatnot). What I get right now is a face (a png file that casts the shadow of the entire image file-not just the visible content) that comes in arbitrarily, and when I try to make it a component I have to explode it and then when I make the component and tick the faceme option, it gets whacked out.
Any detailed info would be great, thanks again. I'd love to be able to use a similar workflow to do what is described in this thread!
-
wahoowetzel
-
- Posts: 31
- Joined: Sun Jul 19, 2009 11:46 pm
- Name: Jesse Wetzel
by rv1974 » Sun Jan 31, 2010 8:47 am
This script must change components axes to bottom center (+aligned to ground plane). Otherwise it useless IMHO.
-
rv1974
-
- Posts: 548
- Joined: Tue Nov 13, 2007 11:38 am
- Name: rv1974
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by wahoowetzel » Sun Jan 31, 2010 9:21 pm
I think that this plugin is useful, I just need to understand the workflow and the steps that come before it. So I'll ask again, what exactly is the process for correctly setting up images for use as faceme objects in SU?
-
wahoowetzel
-
- Posts: 31
- Joined: Sun Jul 19, 2009 11:46 pm
- Name: Jesse Wetzel
by EarthMover » Mon Feb 01, 2010 1:41 am
Here's a quick video of how to go about making a .png into a faceme component as well as a little peek into my workflow using RPTools, Cadplants and the Layer Face Camera plugin. http://www.screencast.com/t/NzhlOTUyNjYtIf you are making your own plants from image files, then the plugin is not very practical, because you have to make the component so making it face the camera is just a mouse click. For me, I use the plugin everyday and without it, my cadplants/rptools workflow wouldn't be practical. I essentially have thousands of high res plants that are cut out perfectly, but not setup as faceme objects. The plugin was born out of necessity for that and I would probably never use it on any other day to day sketchup stuff.
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller Some of my 3D crap
-

EarthMover
- Top SketchUcator
-
- Posts: 1792
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: Adam Hails
by Edson » Sun Sep 19, 2010 12:30 am
could you please show us how does this plugin work? what is the actual workflow?
edson mahfuz, architecthttp://www.mahfuz.arq.brAnyone can get you more for more, but it takes genius to get you more for less.
-

Edson
- Global Moderator
-
- Posts: 2663
- Joined: Mon Oct 22, 2007 1:46 pm
- Location: Porto Alegre, Brasil
- Name: Edson Mahfuz
- Operating system: Mac
- SketchUp version: 2013
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by EarthMover » Mon Sep 27, 2010 3:16 pm
Edson, sorry for the late response. I missed you question. My workflow in doing residential landscape design relies quite heavily on the Cadplant.com library of plants. It's one of the only sketchup friendly libraries that contains the variety and specific representation of the plants I use in my landscape designs. When I first received the libraries, I was very disappointed. First, they were all .tga images, which I had the manufacturer correct to .png. Then they were all components, but none were made to face the camera, which is why the need for this plugin. The other major issue was the quantity of plants and the fact that they were numbered .skp files and not named. It made a quick search for plants impossible, as you have to reference an excel spreadsheet or .pdf file catalog to find the plant you want and cross reference it's number, then look it up by number to add it to your scene. With over 5000 plants spread over multiple collections, this was pure tedium. I needed a search tool. I found the search tool in RPTools to fit the bill. (Same search tool is available for free in the "Project Sketch" plugin) But, in order to effectively use the search tool, I would need to rename all the plants to include both their common and botanical names, so I could more easily access them via search. I did this with a program I found called Advanced Renamer, found here - http://aren.hulubulu.net. I made this video showing a step by step of the renaming process - http://screencast.com/t/WSVVzstKKOnce the plants are renamed and the search tool and "layer face camera" plugin installed, then it's just a matter of searching, selecting and placing all of the plants. Assigning them to a unique layer, then running the plugin. This workflow has been very fast and efficient and has turned sketchup into a quick and easy planting design tool. Here's an old video I made to demonstrate placing the plants and using the plugin. (It's very laggy, but the idea is there) - http://www.screencast.com/t/Axlo8LF2AkAgain, this is a workflow that would be of most benefit to someone in the residential landscape design market. In my opinion, 3D plants are always going to add more realism and work much better for an architects who wants to just add some non-specified greenery. But for me, by utilizing this huge library, I can actually represent the plants in a design, that I am going to buy from a nursery, physically dig a hole for and plant in the ground. (I should also mention that there seems to be an issue between the RPTools Component Browser and SU8. I'm still waiting on a fix from Al & Rich, so the workflow now means modeling in SU8 & adding the plants in SU7. Hopefully resolution will come quickly.)
A designer is an emerging synthesis of artist, inventor, mechanic, objective economist and evolutionary strategist. - R. Buckminster Fuller Some of my 3D crap
-

EarthMover
- Top SketchUcator
-
- Posts: 1792
- Joined: Fri Sep 12, 2008 9:06 pm
- Location: Eastern Pennsylvania
- Name: Adam Hails
Return to Plugins
|