Page 1 of 2

Can AlcScript create objects?

PostPosted: Wed Jul 16, 2008 9:08 am
by Christian Walther
Quick question as I'm still exploring soft volumes:

I have the impression that AlcScript cannot create new PRP objects, it can only attach information to existing Blender objects and influence the way they are transformed into PRP objects. Is that true? So, to make a PRP object that has no inherent relation to any specific Blender scene object (a soft volume union in my case), I need to make an empty Blender object and attach my AlcScript properties to it? Or is there any other way?

(This is a general question, for the specific case of soft volume unions/intersections/inverses I know that I can create them using the U(...) syntax, but I'm exploring creating them separately right now, which gives greater control about their properties.)

Re: Can AlcScript create objects?

PostPosted: Wed Jul 16, 2008 12:56 pm
by Nadnerb
woo, someone else who does it Dox's way. You are correct that Alcscript won't create objects with no relation to existing blender objects, but that doesn't mean you have to create empties for new objects. For softvolume unions you can just stick the script for them inside one of the component softvolumes, and it will create a union object with the name of that volume. (plasma objects only need to have unique names compared to objects of the same type in the same page. Other types, like unions, can have names that are identical to other regions, simple svs, responders, or anything else)

Re: Can AlcScript create objects?

PostPosted: Wed Jul 16, 2008 1:08 pm
by Paradox
Yay! I'm not the only person who hates creating a separate softvolume for each object in the Age!

You can make a complex softvolume from any object, I generally use an existing softvolume mesh or an empty.
Code: Select all
SoftVolumeMesh:
    type: softvolume
    softvolume:
      - type: convex #This exports a basic plSoftVolumeSimple
        softdist: 0
        instrength: 1.0
        outstrength: 0.0

      - type: invert #This creates a plSoftVolumeInvert
        regions:
          - softvolume:SoftVolumeMesh #This is a ref to the plSoftVolumeSimple, which will be inverted

MyEmptyObject:
    type: softvolume
    softvolume:
      - type: union #Creates a plSoftVolumeUnion object named "MyEmptyObject"
        regions:
          - softvolume:SoftVolume2 #a ref to a SoftVolumeSimple
          - svinvert:SoftVolumeMesh #ref to the SoftVolumeInvert that we created above


That should hopefully be clear enough for you to understand, all of the places where you can specify a softvolume as "!(SoftVolumeMesh)" you can also specify a ref to an existing softvolume object.
Valid ref "types" are
Code: Select all
softvolume
svinvert
svunion
svintersect

Re: Can AlcScript create objects?

PostPosted: Wed Jul 16, 2008 1:35 pm
by Christian Walther
Nadnerb wrote:that doesn't mean you have to create empties for new objects. For softvolume unions you can just stick the script for them inside one of the component softvolumes, and it will create a union object with the name of that volume.

Thanks, I'll try that!

Paradox wrote:Yay! I'm not the only person who hates creating a separate softvolume for each object in the Age!

Well, I haven't decided yet whether I hate anything. I'm just exploring all possibilities.

Thanks for your examples, these should be helpful. Incidentally, apart from creating multiple PRP objects on the same Blender object, they pretty much match what I have right now in the soft volume lab corner of my doodle age. :)

When I'm done with this, I plan to write a wiki page about my findings on soft volumes so that others don't have to repeat all the research.

Re: Can AlcScript create objects?

PostPosted: Fri Jul 18, 2008 2:52 am
by Christian Walther
Christian Walther wrote:When I'm done with this, I plan to write a wiki page about my findings on soft volumes so that others don't have to repeat all the research.

OK, done: Soft Volumes. Reviews are welcome!

Re: Can AlcScript create objects?

PostPosted: Sat Jul 19, 2008 5:35 pm
by Paradox
Wow. That's an amazing explanation! It even taught me more about SoftVolumes :D

Re: Can AlcScript create objects?

PostPosted: Sun Jul 20, 2008 12:00 am
by Trylon
Wow - I finally understand softvolumes now.
Thanks for that great article.

Re: Can AlcScript create objects?

PostPosted: Sun Jul 20, 2008 5:07 am
by Christian Walther
Thanks! :D It's nice to hear one's contributions are considered useful.

Thanks for your addition about the kIsNot flag, Paradox. Since it didn't specify the behavior as completely and unambiguously as I prefer, I just went ahead and did that "further research". Result is added to the article.

Re: Can AlcScript create objects?

PostPosted: Sun Jul 20, 2008 5:27 am
by Jojon
Christian Walther wrote:Thanks! :D It's nice to hear one's contributions are considered useful.


Oh yes, yes indeed! I can't even recall ever noticing any mention of the strength/range parameters, before your writing about it, although it was probably out there somewhere, for those who are not completely lost, like myself. :7

Re: Can AlcScript create objects?

PostPosted: Sun Jul 20, 2008 5:42 am
by Christian Walther
Heh, thanks for reminding me to add softdist to the AlcScript page. :)

As far as I remember I only found these properties in the PyPRP source code, which tends to be the most reliable and up-to-date source for such information, if you can read Python.