Notifications
Clear all

[Closed] SDK: node with sub-nodes

SimpleObject2.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

well… try to make it as Helper extension.
a group-head node is expected as Helper by the system. I think that the system filters some messages from group-head node which causes some limitation for modifier panel.
but all types work well in mxs as you can see:

plugin Helper CustomHead
name:"CustomHead"
classID:#(0x2feb1967, 0x0cbc0022)
silentErrors:on
category:"Standard"
extends:Dummy
autoPromoteDelegateProps:on
(
	parameters params rollout:params 
	(
		id type:#integer defualt:0 ui:ui_id animatable:off
	)
	rollout params "Parameters"
	(
		label lb "Custom Head (Helper)" align:#center
		spinner ui_id "ID: " fieldwidth:64 type:#integer range:[-1e9,1e9,0]
	)
)

plugin SimpleObject CustObjHead
name:"CustObjHead"
classID:#(0x2feb1967, 0x0cbc0023)
silentErrors:on
category:"Standard"
autoPromoteDelegateProps:on
(
	parameters params rollout:params 
	(
		id type:#integer defualt:0 ui:ui_id animatable:off
	)
	rollout params "Parameters"
	(
		label lb "Custom Head (Simple Object)" align:#center
		spinner ui_id "ID: " fieldwidth:64 type:#integer range:[-1e9,1e9,0]
	)
	tool create
	(
		on mousePoint click do case click of
		(
			1: 
			(
				nodeTM.translation = gridPoint
				#stop
			)
		)
		on mouseMove click do case click of
		(
		)
	)	
)
	

delete objects
with redraw off
(
	c = CustomHead id:123 isselected:on
	setgrouphead c on
	d1 = dummy pos:[20,0,0]
	d2 = dummy pos:[40,0,0]
	attachnodestogroup #(d1,d2) c 
	setgrouphead c off

	c = CustObjHead pos:[0,0,-20] id:123 isselected:on
	setgrouphead c on
	d1 = dummy pos:[20,0,-20]
	d2 = dummy pos:[40,0,-20]
	attachnodestogroup #(d1,d2) c 
	setgrouphead c off
	
	b = box width:10 length:10 height:10 pos:[0,0,20] isseleted:on
	setgrouphead b on
	d1 = dummy pos:[20,0,20]
	d2 = dummy pos:[40,0,20]
	attachnodestogroup #(d1,d2) b
	setgrouphead b off
	
	redrawviews()
) 

so it’s more likely that is something wrong in your code and plugin description.

Thank you for the sample code Denis, I’ll compare it to my plugin code and see if I can rectify the two.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

do you use plugin wizard?

The plugin I’m working on is already fully developed and production ready, I was just trying to see if I could add this functionality to it. I may have started it using the wizard, but that was several years ago so I can’t remember.

Page 2 / 2