It is currently Thu Jun 18, 2026 7:02 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 9:10 pm  (#1) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
Are there any functioning scripts i can look at to see how it is used?


Thanks. :)

_________________
Image


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 9:38 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Rod this may help It's from a script I have never posed I've used the plugin to create spheres boxes and cylinders within scripts

(plug-in-map-object RUN-NONINTERACTIVE image pole-layer
         3                  ; Type of mapping (0=plane,1=sphere,2=box,3=cylinder)
         0.5 0.5 2.0           ; viewpoint
         0.5 0.5 0.0           ; object pos
         1.0 0.0 0.0           ; first axis
         0.0 1.0 0.0           ; 2nd axis
         20.0 -25.0 0.0        ; axis rotation
         1 '(255 255 255)     ; Type of lightsource (0=point,1=directional,2=none)and Lightsource color (r,g,b)
         -0.5 -0.5 2           ; light position
         -1.0 -1.0 1.0        ; light direction
         0.3 1.2 0.7 0.0 27.0 ; material (amb, diff, refl, spec, high)
         TRUE               ; antialias
         FALSE                ; tile
         FALSE                ; new image
         TRUE                ; transparency
         .05                   ; Sphere/cylinder radius (only used when maptype=1 or 3)
         0.5 0.5 0.5            ; box size
         1.00                 ; unused parameter Cylinder length
         -1                   ; Box front face (set these to -1 if not used)
         -1                   ; Box back face
         -1                   ; Box top face
         -1                   ; Box bottom face
         -1                   ; Box left face
         -1                   ; Box right face
         -1                   ; Cylinder top face (unused parameter)
         -1)                  ; Cylinder bottom face (unused parameter)

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 9:56 pm  (#3) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
Thanks Graechan this will help immensely!

_________________
Image


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 10:01 pm  (#4) 
Hi Rod,
Draconian's Metalwurx Indicator Lights script uses the that function too I think....


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 10:05 pm  (#5) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
I had gotten it pretty close but had the TRUE and FALSE values set to 1's and 0's :P

Thanks again Graechan! :ninja

Thanks fluffybunny. :)

_________________
Image


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 10:37 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
no worries Rod, the only other thing I can add is that if mapping to box is used it's slow, very slow

for my rubicks cube script I wrote 2 scripts, 1 using map object and 1 using GMIC

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 11:31 pm  (#7) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
Graechan wrote:
no worries Rod, the only other thing I can add is that if mapping to box is used it's slow, very slow

for my rubicks cube script I wrote 2 scripts, 1 using map object and 1 using GMIC


Ok thanks for the heads up. :bigthup :)

_________________
Image


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Thu Apr 11, 2013 11:37 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
Graechan how would i use the rotation X as a variable for my script interface?
I want to be able to rotate the object on an x plane from -180 to 180.
I tried Rotation in my define variables and replaced the x value with that string but it fails with a unrecognized value for position 17.

Like this is what i am after. :)
Image

Here is my script
(plug-in-map-object RUN-NONINTERACTIVE image layer
         0                  ; Type of mapping (0=plane,1=sphere,2=box,3=cylinder)
         0.5 0.5 2.0           ; viewpoint
         0.5 0.5 -0.16           ; object pos
         1.0 0.0 0.0           ; first axis
         0.0 1.0 0.0           ; 2nd axis
         Rotation 0.0 -70.0         ; axis rotation
         2 '(255 255 255)     ; Type of lightsource (0=point,1=directional,2=none)and Lightsource color (r,g,b)
         0.0 0.0 0.0           ; light position
         0.0 0.0 0.0        ; light direction
         0.3 1.0 0.5 0.5 27.0 ; material (amb, diff, refl, spec, high)

_________________
Image


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Fri Apr 12, 2013 12:12 am  (#9) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Rod would(number->string rotation)help

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Fri Apr 12, 2013 1:07 am, edited 1 time in total.

Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Fri Apr 12, 2013 1:04 am  (#10) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Rod wrote:
Are there any functioning scripts i can look at to see how it is used?


Thanks. :)


I used Map Object in my Projection To Dodecahedron script. I used to have quite a few notes about scripting Map Object but have misplaced them (I should have published them but they were never "complete").

It is probably best to treat plug-in-map-object as four separate plug-ins because many of the parameters become meaningless once you choose a particular target object type (plane, cylinder, sphere, or box); and some of the parameters' meanings change depending on the object type.

Rod wrote:
Graechan how would i use the rotation X as a variable for my script interface?
I want to be able to rotate the object on an x plane from -180 to 180.
I tried Rotation in my define variables and replaced the x value with that string but it fails with a unrecognized value for position 17.

Your code should work as long as the variable Rotation is defined (remember that Script-fu is case-sensitive). Could you share more of your script?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Fri Apr 12, 2013 1:05 am  (#11) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Ignore the string Idea I tried it and it failed but this worked ( I needed 20.0) note the end of the variable let* is at the end of the plugin settings

   (let* ( (value (+ 10 10)))
   
   (plug-in-map-object RUN-NONINTERACTIVE image pole-layer
         3                  ; Type of mapping (0=plane,1=sphere,2=box,3=cylinder)
         0.5 0.5 2.0           ; viewpoint
         0.5 0.5 0.0           ; object pos
         1.0 0.0 0.0           ; first axis
         0.0 1.0 0.0           ; 2nd axis
         value -25.0 0.0        ; axis rotation
         1 '(255 255 255)     ; Type of lightsource (0=point,1=directional,2=none)and Lightsource color (r,g,b)
         -0.5 -0.5 2           ; light position
         -1.0 -1.0 1.0        ; light direction
         0.3 1.2 0.7 0.0 27.0 ; material (amb, diff, refl, spec, high)
         TRUE               ; antialias
         FALSE                ; tile
         FALSE                ; new image
         TRUE                ; transparency
         .05                   ; Sphere/cylinder radius (only used when maptype=1 or 3)
         0.5 0.5 0.5            ; box size
         1.00                 ; unused parameter Cylinder length
         -1                   ; Box front face (set these to -1 if not used)
         -1                   ; Box back face
         -1                   ; Box top face
         -1                   ; Box bottom face
         -1                   ; Box left face
         -1                   ; Box right face
         -1                   ; Cylinder top face (unused parameter)
         -1))                  ; Cylinder bottom face (unused parameter)

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Fri Apr 12, 2013 1:18 am  (#12) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
Yes! That worked sweet. :)
Thank you so much for all your help Graechan.

I am off to bed now. :otb :yr

_________________
Image


Top
 Post subject: Re: Calling plugin-map-object within a SCM file?
PostPosted: Fri Apr 12, 2013 2:27 pm  (#13) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16030
saulgoode wrote:
Rod wrote:
Are there any functioning scripts i can look at to see how it is used?


Thanks. :)


I used Map Object in my Projection To Dodecahedron script. I used to have quite a few notes about scripting Map Object but have misplaced them (I should have published them but they were never "complete").

It is probably best to treat plug-in-map-object as four separate plug-ins because many of the parameters become meaningless once you choose a particular target object type (plane, cylinder, sphere, or box); and some of the parameters' meanings change depending on the object type.

Rod wrote:
Graechan how would i use the rotation X as a variable for my script interface?
I want to be able to rotate the object on an x plane from -180 to 180.
I tried Rotation in my define variables and replaced the x value with that string but it fails with a unrecognized value for position 17.

Your code should work as long as the variable Rotation is defined (remember that Script-fu is case-sensitive). Could you share more of your script?


Saulgoode i am very sorry i didn't see your post until i checked my email today.I had used the string rotation and defined it in my define tag but for some reason it still wouldn't work.It worked well with the Let tag however.Thanks for your help though.I find all your answers very informative and i learn much from them.I will check out your script and study it well.

_________________
Image


Top
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group