Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Instances from Compound Scatter object

Instances from Compound Scatter object

Anonymous
Not applicable
814 Views
5 Replies
Message 1 of 6

Instances from Compound Scatter object

Anonymous
Not applicable

Hello! How in C++ SDK to read actual matrix transformations and referenced object mesh for scatter compound object? 

https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/3DSMa...
I have lost digging in SDK, can't find it.

Currently obj->GetRenderMesh method give collapsed bug mesh that contains all resolved and transformed instances. It can be a lot of geometry.

Best regards,

Aaron

0 Likes
815 Views
5 Replies
Replies (5)
Message 2 of 6

denisT.MaxDoctor
Advisor
Advisor

you have to look at the reference targets of the object ...
as I can see they are under the reference target 0 - (Scatter: source) and 1 - (Scatter: distribution) (2nd and 3rd reference targets are transforms)
after that you have to query the reference targets of the source and distribution Scatters to get their objects ... and so on
  

0 Likes
Message 3 of 6

Anonymous
Not applicable

How to do that in c++ sdk?

0 Likes
Message 4 of 6

denisT.MaxDoctor
Advisor
Advisor

@Anonymous wrote:

How to do that in c++ sdk?


Are you kidding? 

 

ReferenceTarget:: GetReference(int i);

0 Likes
Message 5 of 6

denisT.MaxDoctor
Advisor
Advisor

This amazes me - I want to do it with the SDK!
Let's first figure out how it is all assembled and how it works!

 

go to the mxs listener and run something like:

 

fn dumpReferenceTargets obj token:"" recurse:on = if isvalidobj obj do
(
	num = refs.getnumrefs obj
	format "%% (%)\n" token obj num
	for k=1 to num do 
	(
		ref = refs.getreference obj k
		format "%\t% > %\n" token k (if ref != undefined then ref else "")
		if recurse do dumpReferenceTargets ref token:(token + "\t") recurse:on
	)
)

 

 

 

dumpReferenceTargets < compound scatter >

 

 

after you understand the base you can implement it with c++

0 Likes
Message 6 of 6

Anonymous
Not applicable

I will look into this direction, thanks for advice! 🙂

As for kidding, I just was writting from cell phone without help manual under my hand

0 Likes