Notifications
Clear all

[Closed] self reference geo Plugins

Quick question I had rather than starting a brand new thread for it.

When creating a geoPlugin how do you properly reference itself?
Rather than selection[1]

because not in all cases is that geo selected.

such as

on buildMesh do
(
    --build mesh function
     
    --?-- this.node.material = undefined
    --?-- this.node.wirecolor = random black white
)
10 Replies
2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

the first… what geoPlugin is?

(@jokermartini)
Joined: 11 months ago

Posts: 0

I’m creating a geometry plugin and I need to reference itself.

For the sake of example so I want to adjust the material of itself…


on buildMesh do 
( 
--build mesh function 
--?-- this.node.material = undefined 
--?-- this.node.wirecolor = random black white 
)

refs.dependentnodes this firstonly:true

should do the trick

I do not know how far to move each knot’s handle to make a perfect circle

sadly that doesn’t work right

as i remember a geometry plugin doesn’t have buildMesh handler.

the geometry plugin can extend any other primitive plugins. in this case (refs.dependentnodes this firstonly:on) has to work.

I mean Scripted SimpleObject Plug-ins not GeoPlugins…


plugin simpleObject tower_plugin_def

name:"Tower"

classID:#(145345,543211)

category:"Scripted Primitives"

( 

parameters main rollout:params

(

height type:#worldUnits ui:height default:0

width type:#worldUnits ui:width default:0

depth type:#worldUnits ui:depth default:0

)

rollout params "Two Faces Parameters"

(

spinner height "Height" type:#worldunits range:[-1000,1000,0]

spinner width "Width" type:#worldunits range:[-1000,1000,0]

spinner depth "Depth" type:#worldunits range:[-1000,1000,0]

)

on buildMesh do

(

setMesh mesh \

verts:#([0,0,0],[width,0,0],[width,depth,0],[0,depth,0]) \

faces:#([3,2,1], [1,4,3])

extrudeFace mesh #(1,2) (height * 0.5) 40 dir:#common

extrudeFace mesh #(1,2) (height * 0.5) 50 dir:#common

)

tool create

(

on mousePoint click do

case click of

(

1: nodeTM.translation = gridPoint

3: #stop

)

on mouseMove click do

case click of

(

2: (width = gridDist.x; depth = gridDist.y)

3: height = gridDist.z

)

)

)


1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i knew it… so in your case the node is (refs.dependentnodes this firstonly:on)

Alright. I’ll try it out again and see what happens.