PDA

View Full Version : a plugin needed



procyon99
08-23-2010, 06:14 PM
hello all, i'm doing a low res landscape, a lot of 3 polys face trees and shrubs, did the cloning one by one, but now i want to do a random rotate, scale or stretch for diferent items, is ther a plugin that can do that, or i can do it in lw directly?

nickdigital
08-23-2010, 06:51 PM
There are various cloning plug-ins for Modeler that would help you do this. Go to Flay.com and do a search for "clone" under the plug-in link.

HDInstance for Layout would do what you want really easily too.

zardoz
08-23-2010, 07:57 PM
well, for that you could download this plugin from pictrix http://www.pictrix.jp/?s=Spray&submit=Search
and with the layer with your terrain selected (in the foreground) in modeler, use the plugin px_spray to spray points where you want them.
then select the points and cut/paste them to another layer. then use PointClonePlus (comes with lightwave) to clone a tree (in the foreground layer) using the sprayed points (in the background layer)

procyon99
08-23-2010, 08:16 PM
oh no, you got me wrong, i did the clone of my trees objects in layout, and the clone is already done, each tree in it's location, but now i have a lot of cloned items and i want to make a random rotation and scale for a multy selected items, is ther any plugin that may do that? and it should do it after the clone, not another random cloner in layout, just a random translator in layout for multi objects selected.

nickdigital
08-23-2010, 08:42 PM
oh no, you got me wrong, i did the clone of my trees objects in layout, and the clone is already done, each tree in it's location, but now i have a lot of cloned items and i want to make a random rotation and scale for a multy selected items, is ther any plugin that may do that? and it should do it after the clone, not another random cloner in layout, just a random translator in layout for multi objects selected.

HDInstance will do what you want. It renders instances of your geometry. It's not free though.

I don't know of a plug-in to do what you're asking that's free except for good old fashioned do it yourself hard work. :)

procyon99
08-23-2010, 08:51 PM
yes i know about hd, but i dont want to clone randomly, all what i want is to random scale and rotation for already placed cloned items, i guess ther should be a script or plugin that do this thing, or it will be very tedious work to it manually, wich i can script it, since it seems easy to do

xchrisx
08-23-2010, 11:48 PM
here is something I wrote real quick. I didnt spend a lot of time building out options for each channel but you should be able to quickly modify it to suit your needs. It basically takes whatever your selected objects are and gives them a random value to scale, rotation, or both. I documented the code so you can see whats going on. If you would prefer it to just add to the existing values instead of writing over them change Rotation to AddRotation and Scale to AddScale. Hopefully this at least gets you started.

procyon99
08-24-2010, 01:24 AM
WOW, thank you xchrisx, this is not bad at all, a quick question since i have no 64 bit access now, can it run under win 7 64 bit?
is it possible to add the following and it will get perfect:
-define the axis of rotation
-put 3 axis scale, (min and max for each axe )so it will stretch also
-make it remember last settings

again thank you for your great help

procyon99
08-24-2010, 06:35 AM
@ xchrisx, please find a modified work
i already modified the rotation axis to be on the vertical axe since trees will not rotate on other axis, i added 3 scale values, now i will ask your help about the rest if you please.
-can we make it remember last settings
-the most important part, can we make 2 options in scale values, one like the current one, wich is real values, and another one for percentage, so whatever is the scale for an object in the scene, RSR (random scale rotate) will vary it's scale up to the percentage, say min 80%, max 120%, and if i have a tree with already scale of 1.5m on the y axis, it will get a 80-120 % range variation of scale, this way if you have several trees each one already have it's scale, you will maintain the proportion with a global variation of percentage.
in another way, is it possible to make 2 option in scale, one that apply a scale value, and another that read the current scale of each object and apply a scale percentage over it?
thanks for your help

xchrisx
08-24-2010, 09:02 AM
I will take a look later today once I get home from work. :)

Matt
08-24-2010, 09:41 AM
here is something I wrote real quick.

Nice one Chris, you're as bad as me for doing quick LScripts on request! It's fun though!

:)

xchrisx
08-24-2010, 09:52 AM
That it is Matt :) Btw, congrats on your new gig at Newtek.

procyon99
08-24-2010, 12:15 PM
thanks chris for your help, will appreciate any feedback to finalize the project i'm using this script for, and for Matt i will say, congrats man, and looking forward for all goods coming to the lw UI at least from your side, expectations are high and i know you are the man for this job, good luck.

xchrisx
08-24-2010, 11:47 PM
attached is an updated script with what i believe are the changes you had wanted. i only tested it a few times because it is getting late so hopefully nothing breaks. if there is a bug let me know and I will try to fix it. the script just about quadrupled in size due to all of the options so I tried to break it up into sections to be more manageable. hopefully this helps :thumbsup:

procyon99
08-25-2010, 04:21 AM
exactly what it should be, the only bug is that it doesnt work with multi selection, it only takes the first selected item, first version was working with multi selection.
much appreciate your help chris, thanks

xchrisx
08-25-2010, 09:04 AM
Whoops my bad... was pretty tired last night must have missed that. All fixed now.

-chris

Caveboy
08-25-2010, 01:10 PM
What a nice guy! So helpful.

:thumbsup:

nickdigital
08-25-2010, 01:56 PM
What a nice guy! So helpful.

:thumbsup:

+1! The LW community in action.

procyon99
08-25-2010, 02:46 PM
thanks chris, u made my day, i will use it and post some renders wher i use this usefull tool.

procyon99
08-26-2010, 06:37 PM
this is some renders of how i use random scale rotate, to modify scale and rotation of pre cloned trees, speaking of trees. i'm not happy with the result of these clipmaped trees, do u think a one polygon climap tree will be better, one poly tree facing camera, and speaking of facing camera, i have polas olas facing to cam but it wont work on win7 64, and i dont find any other plugin that make the same job, do u think chris it's possible to make a script for this issue?

wesleycorgi
08-26-2010, 10:48 PM
Chris, that is cool. I checked out your site; some good stuff including your library of Lscripts. Is your article on Lscript in 3D World available somewhere online? I didn't have a subscription last year, so I missed that article.

xchrisx
08-27-2010, 09:39 AM
procyon99: Nice renders, I see what you mean about the clip map objects showing their X look. You could probably try to use a single card instead of 2, but I think the shadows might make it look even more like a 2D card if you do that. As for FaceToCam, I have never used it, but from what I am guessing it just takes an object and targets the camera so that it always faces it probably on the heading of an object. If that is what it does then I am positive it can be scripted. If I am wrong I would need clarification of what it does.

wesleycorgi: Hopefully some of those scripts will be useful to you. I am not aware of the article available online, it probably has to be ordered from 3DWorld. If you don't want to get the mag and have some understanding of programming you can open up any of my scripts in notepad and probably follow what I am doing if you would like to learn LScript. Oh, and if you find any bugs in any of my scripts let me know. I wrote some a few years ago (some in Lightwave 8.x days) and haven't gone back through all of them to make sure they are bug free and work with LW 9.x.

xchrisx
08-27-2010, 03:18 PM
procyon99: for trees to Face the Camera:
1. select all of your tree cards
2. go into the motion options panel
3. Set them to target your camera
4. under rotation options set Pitch back to "Keyframes" instead of Point At Target.

That should give you the same effect of always looking at the camera but only changing the Heading channel.

procyon99
08-27-2010, 06:34 PM
chris,
the plugin should not work this way, it should make the polygons always have it's normal facing the camera, and not only make them face the camera plan, it should face it as a center point of a big sphere, i wish i was clear in clarifying this issue.