Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Prim Mirror Script Now Available!

Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
12-29-2005 16:44
From: Argent Stonecutter
I'm trying to write a script to "flip" an existing object through the X, Y, or Z axes. I've gotten the position and rotation working, and I'm trying to use this script to reverse the parameters of the object... and I really don't understand the data flow through the script. I've gotten tantalizingly close but I'm not there yet.

Wouldn't code to just flip an existing prim be safer, as well as easier to understand?

Yeah. That's pretty much what I changed it to do back when "teh drahma" hit. Backhanded myself for not thinking of it prior.


And... yeah, this script does "flip" an existing prim through X, Y, and Z. The param magic isn't *that* difficult, but takes a bit of trial and error. It also suffers from small things like prim torture, since llGetPrimitiveParams has issues with "getting" params from other prim shapes implicitly.



And to the necropo^H^H^H^H^H^H folks posting their praise, thanks! :)
_____________________
---
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
12-29-2005 16:50
Also, I just changed the first post to reflect the changes I made back in the day. I just... err... forgot.

Fixed now!


Also, I'm noticing this thing is poorly documented looking at it again. Would there be any interest in me cleaning up the docs to make it more readable?
_____________________
---
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
12-29-2005 23:12
From: Jeffrey Gomez
Yeah. That's pretty much what I changed it to do back when "teh drahma" hit. Backhanded myself for not thinking of it prior.
I've looked at the code every way and it looks like it still is designed to make a second prim into the mirror image of the first prim... rather than mirroring the prim it's in. Are you sure we're talking about the same thing?

Better docs would be greatly appreciated. :)
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
12-30-2005 00:05
Yeah, it originally made a second prim. I just copy-pasted some of the code to make it move itself instead of make a different prim, which it does. But in hindsight, some major *cough* fixing is probably in order.


I'll see if I can clean it up a bit over the weekend. Since I'll be looking at it again rather soon for my offline builder anyway, better docs and workflow could drastically improve what I'm working on now.
_____________________
---
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-01-2006 03:46
New version is up!
/15/9a/38165/1.html#post409811


You're welcome. :)
_____________________
---
Zippthorne Pasternak
Registered User
Join date: 6 Dec 2005
Posts: 6
01-04-2006 14:06
From: Jeffrey Gomez
It also suffers from small things like prim torture, since llGetPrimitiveParams has issues with "getting" params from other prim shapes implicitly.


As in, it won't get them at all or you think there is a way to get them?

related: are there any "torture" techniques which use "unuseable" values other than dimple? If that's the only one, it should be fairly easy to extract that information despite its not being included in the regular output.

In my limited experiments, only dimple has had any effect on the tortured prim that could not be accounted for by adjusting the visible values.
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
Mirror mirror on the wall...
01-12-2006 18:19
Jeffrey-

Thank You! I was just about to try my hand at something that would reverse splintered tori and you've saved me several hours of effort! (I can reverse nearly anything else by hand with ease.)

Finally... symmetrical ears! \:)/
_____________________
* The Particle Laboratory * - One of SecondLife's Oldest Learning Resources.
Free particle, control and targetting scripts. Numerous in-depth visual demonstrations, and multiple sandbox areas.
-
Stop by and try out Jopsy's new "Porgan 1800" an advanced steampunk styled 'particle organ' and the new particle texture store!
Stephen Nosferatu
Registered User
Join date: 11 Jan 2006
Posts: 3
02-04-2006 03:08
This is my first post and I have to say great job. I still havent figured it out yet. But like alot of us here who are used to working with higher end 3d modeling software. SL building software is clunky at best.
It is not Jeffrey's fault on the design of SL software. I have made models for both proffesional use and recreation for over 10 years. I can look at an object and tell how its made. What makes matters worse for people who want to sell is if you right click on the object it gives you the whole outline of its design. The truth remains is that it was just a matter of time before basic objects like houses were all to common. Lets face it there big boxes. About the only thing I have been fairly impressed with when it comes to objects are of the organic nature. These organic models would still take alot of time to duplicate even if they used this script.
For the record I can make just about any object in this game, I cant script anything to save my life. So I still buy things within the simulator, mainly because sometimes I am either to lazy or just do not have the time.

Just my 2 cents worth :)
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
08-02-2006 20:30
I tried adding the large script into a prim, and got a syntax error at line 300, 146
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
08-02-2006 21:30
First off.. I'm totally in love with this script. THANK YOU!

Secondly.. part of the reason I wanted this, was to make it easier to edit the intricate parts of objects, like making a right shoe, and then a left shoe. Problem is.. a lot of these items use "tiny prims" ie.. prims that have odd attributes applied to them, like cubes, cylanders, or other objects with dimple (or other alien attributes) applied.

I tried using your flip script (did I mention I'm in love with it?).. but the buckles on my new shoe got all fat, and reverted to non-dimpled. is there a way to add flipping all the attributes to all the object types?

edit: it's a fairlt simple matter to go in and manually edit the few objects this affects in a buckle or shoe.. so I'm not that concerned about it ATM. The positioning and rotation are spot on, so I have had little difficulty in finishing an object like a shoe's mate or whatnot.. just have to re "torture" the prim I guess.. kind of tough in places. I beter start using uniform dimple settings, eh?
Chloris Hathor
Registered User
Join date: 8 Jan 2005
Posts: 115
12-14-2006 08:18
i cant figure this out for the life of me, i am not very familiar with scripts, i have read the instructions a few times and tried it a couple times, but i still cant get it to work. could somebody who understands this script maybe help explain to me a little better? im lost! lol
Tiarnalalon Sismondi
Registered User
Join date: 1 Jun 2006
Posts: 402
12-14-2006 08:22
There should be a freebie of it in world that you can use. -> much easier.

I will be going home for lunch in about 5 minutes so shoot me an IM and I'll give you my prim mirror folder when I get there.
Iris Bourdeille
Registered User
Join date: 12 Jul 2006
Posts: 59
12-21-2006 03:31
ignore this i figured it out.
Doradiia Nuvolari
Registered User
Join date: 6 Aug 2006
Posts: 31
01-08-2007 08:48
From: Winter Ventura
...just have to re "torture" the prim I guess.. kind of tough in places. I beter start using uniform dimple settings, eh?


I'm not sure, but I think you could just temporarily halfway untourture your prims to spheres to before mirroring. The dimple value should get converted and all you would have to do is change them back to cubes or whatever.

I can't remember if switching might muss up any other values, though.

It seems to me like the problem is that LSL doesn't give you a way to detect the dimple and other tourture values in a prim that wasn't designed to have those values. I suppose the script could temporarily convert each prim, for example to a sphere to check for dimple.

I won't get too into it, as I'm new to scripting and not overly familiar with these functions.
Darien Martin
Registered User
Join date: 11 Oct 2005
Posts: 1
Note card for the Mirror
04-11-2007 17:57
Would i be able to get a note card of how the Mirror is supose to be set up and all so i can use this to build the mecha i'v been working on for a while now? I don't know how to set it up or use it so any instructions would be good please
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
05-02-2007 17:09
This can be a very useful script. Thank you Jeffrey for sharing it.

I found a couple of typing errors in the script that kept it from compiling, in the words holesize and radiusoffset. The line near the bottom that reads:

CODE
else if(type > 3) // Tube, Torus, Ring: 
{
llSetPrimitiveParams([PRIM_POSITION,pos,PRIM_ROTATION,rot,PRIM_SIZE,size ,PRIM_TYPE,type,holeshape,cut,hollow,twist,holesiz e,topshear,advancedcut,taper,revolutions,radiusoff set,skew]);


should read this way when the extra spaces are deleted"

CODE
else if(type > 3) // Tube, Torus, Ring: 
{
llSetPrimitiveParams([PRIM_POSITION,pos,PRIM_ROTATION,rot,PRIM_SIZE,size ,PRIM_TYPE,type,holeshape,cut,hollow,twist,holesize,topshear,advancedcut,taper,revolutions,radiusoffset,skew]);
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Jeff Kelley
Registered User
Join date: 8 Nov 2006
Posts: 223
05-02-2007 23:00
From: Jeffrey Gomez
The fact you have now twice called this "just another prim copier" upsets me, because it only builds on the level of naivete that started the drama in the first place. And, in a lot of ways, I did overestimate the technical knowledge of residents over this.
A prim cloner is way simpler than your code and easy exercise for an average coder. So naivete? Yes. Protection by obscurity never worked.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-02-2007 23:38
From: Jeff Kelley
A prim cloner is way simpler than your code and easy exercise for an average coder. So naivete? Yes. Protection by obscurity never worked.


Ummmmmm.....

Didn't you notice the message you just responded to is over two YEARS old?

The Thread Necromancer claims another victim.

A LOUSY prim cloner is easy, yes.

A GOOD prim cloner is NOT "way simpler" than his code, because that is precisely what it does, with the added computations to mirror the prim around a fulcrum.

I made an improved version of Jeffrey's version about 8 months ago, cleaning it up and fixing some minor bugs, plus adding automation. However, the automation is borked now, because you can't recompile scripts in selection anymore, and llGiveInventory to child prims worked spotty at best.

Also, you don't understand what he meant there. He wasn't talking about naivety in terms of "protecting his code" (esp since he GAVE it away with full source at the time); it had to do with a huge outcry in the forums similar to that of CopyBot. People didn't understand what it did, and were making claims that he made a theft tool which copied objects perfectly and exploited around the permissions system.
Jeff Kelley
Registered User
Join date: 8 Nov 2006
Posts: 223
05-03-2007 03:54
From: Talarus Luan
Didn't you notice the message you just responded to is over two YEARS old?
Sorry. I was fooled by a follow-up that put it over the stack.

From: Talarus Luan
Also, you don't understand what he meant there. He wasn't talking about naivety in terms of "protecting his code" (esp since he GAVE it away with full source at the time); it had to do with a huge outcry in the forums similar to that of CopyBot. People didn't understand what it did, and were making claims that he made a theft tool which copied objects perfectly and exploited around the permissions system.
That's exactly what I understood, Talarus. -copy +mod for a prim is pointless and builders should know that. More exactly, we should make that known rather than hide it. If you can put a script in a prim, you can get all primitive parameters. If you can get all primitive parameters, you can clone the prim. This is not an exploit. This is LSL features. And this is not thieving as long as we respect IP.

Is it simple or not so simple? This is a side discussion. Chatting the output of llGetPrimitiveParams and feeding to llSetPrimitiveParams works for me. That's hmmm... 100 lines.
LeVey Palou
Registered User
Join date: 31 Aug 2006
Posts: 131
05-06-2007 05:20
This is an awesome building tool. I have been using a similar script i ripped out of one of those mannequins you see on slx. Didnt need the figure i needed the mirror script and put it into a cube, painted the face bright green and the rest black so i knew which one to face towards me when building and has been very useful tool. I tested your script out and works just the same and YAY i can copy this one....was so afraid i would delete the cube on accident with the no copy script in it...lol.


Any how TY! This is great!
Morgoth Melnik
Registered User
Join date: 24 Dec 2007
Posts: 4
04-14-2008 03:54
I'm trying to use this script to mirror a leg I made, but I am getting into terrible trouble with it. The leg is a linked set of prims, so I started off with two unlinked copies of the leg prims. Into the prims of one set, one by one, I was putting the prim base script for the 'mirror prim' and into the other, the mirroring script, in the hope that it would mirror them one by one.

Unfortunately, the prims go all over the place when mirrored. Some of them end up upside down while others do not and I don't understand why. This is driving me insane I would really appreciate it if someone could give me some help. Is it because the leg does not use a consistent orientation for the x y z etc axis?
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
04-14-2008 05:04
From: Morgoth Melnik
I'm trying to use this script to mirror a leg I made, but I am getting into terrible trouble with it. The leg is a linked set of prims, so I started off with two unlinked copies of the leg prims. Into the prims of one set, one by one, I was putting the prim base script for the 'mirror prim' and into the other, the mirroring script, in the hope that it would mirror them one by one.

Unfortunately, the prims go all over the place when mirrored. Some of them end up upside down while others do not and I don't understand why. This is driving me insane I would really appreciate it if someone could give me some help. Is it because the leg does not use a consistent orientation for the x y z etc axis?


I'll send you a copy of my inworld set for this. it comes with some instructions that should make it a bit easier to follow.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
MagickaL Vollmar
Registered User
Join date: 2 Feb 2008
Posts: 1
05-03-2008 10:01
Oh it works really nice! thanks you
Dexter Kaupas
DK Designs
Join date: 14 Sep 2006
Posts: 14
Mirror Rezzed
06-02-2008 13:34
Hi Jeffrey

I build a complex stair sysmten that i need to mirror to the left side. I copy and compile your script so i was rerading so far seem to be so good, but when i drop over the prim to mirror, i got a message that i need a mirror rezzer and im no good with script and i dont know what that mirror rezzer is. Could you help me??
Ignatz Jarvinen
Registered User
Join date: 9 Nov 2008
Posts: 27
11-13-2008 07:34
Er.... someone can tell me how to use it?
1 2 3 4