14 posts • Page 1 of 1
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.
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
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.
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 ]
Thanks so much Jim! (and Majid) The code works great and is exactly what I needed.
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.
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.
wowww mates...Sketchup progress by you ,ruby scripters is unblievable. thanx mates
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!
This script must change components axes to bottom center (+aligned to ground plane).
Otherwise it useless IMHO.
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?
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/NzhlOTUyNjYt
If 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.
could you please show us how does this plugin work? what is the actual workflow?
edson mahfuz, architect
Anyone can get you more for more, but it takes genius to get you more for less.
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/WSVVzstKK
Once 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/Axlo8LF2Ak
Again, 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.)
14 posts • Page 1 of 1