Can AlcScript create objects?

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Can AlcScript create objects?

Postby Christian Walther » Wed Jul 16, 2008 9:08 am

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.)
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Can AlcScript create objects?

Postby Nadnerb » Wed Jul 16, 2008 12:56 pm

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)
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Can AlcScript create objects?

Postby Paradox » Wed Jul 16, 2008 1:08 pm

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
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Can AlcScript create objects?

Postby Christian Walther » Wed Jul 16, 2008 1:35 pm

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.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Can AlcScript create objects?

Postby Christian Walther » Fri Jul 18, 2008 2:52 am

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!
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Can AlcScript create objects?

Postby Paradox » Sat Jul 19, 2008 5:35 pm

Wow. That's an amazing explanation! It even taught me more about SoftVolumes :D
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Can AlcScript create objects?

Postby Trylon » Sun Jul 20, 2008 12:00 am

Wow - I finally understand softvolumes now.
Thanks for that great article.
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: Can AlcScript create objects?

Postby Christian Walther » Sun Jul 20, 2008 5:07 am

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.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: Can AlcScript create objects?

Postby Jojon » Sun Jul 20, 2008 5:27 am

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
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Can AlcScript create objects?

Postby Christian Walther » Sun Jul 20, 2008 5:42 am

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.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 6 guests

cron