Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

How to create physical sky on C++code?

Author
Message
  Topic Search Topic Search
zhhm156156 View Drop Down
Member
Member


Joined: 2018 Aug 09
Online Status: Offline
Posts: 5
Direct Link To This Post Topic: How to create physical sky on C++code?
    Posted: 2018 Aug 12 at 6:19pm

User Information:

Cinema 4D Version:   19 
Platform:   Windows  ;   
Language(s):     C++  ;   

---------

How to create physical sky on C++code? I just have looked for a word(OSkyShader) but not working in my project. could you please give me some example about physical sky?


part of my code:

baseObject* PhysicalSky = baseObject::Alloc(OSkyShader);

Back to Top
MaximeA View Drop Down
Forum Moderator
Forum Moderator

Forum Moderator

Joined: 2018 Jan 04
Location: France - Nantes
Online Status: Offline
Posts: 119
Direct Link To This Post Posted: 2018 Aug 13 at 4:05am
Hi zhhm156156,

First of all welcome in the plugin cafe community!

Physical objects is a bit special. Here is what a basic object will look like.
BaseObject* PhysicalSky = BaseObject::Alloc(1011146);
if (PhysicalSky == nullptr)
return;
doc->InsertObject(PhysicalSky);
EventAdd();
You can know such ID, by drag and drop a Physical sky you created from c4d to the console.

But, since a physical sky is a bit special (when you edit it you can see there are some materials), so in order to get them fully initialized you should call a command since you can't manually initialize them due to some classes not exposed in the SDK. So the correct way to do it is the following.
    CallCommand(1011145);
    BaseObject* PhysicalSky = doc->GetActiveObject();
You can know the command ID by looking at the script log while creating a Physical Sky object.

Hope it's helpful, if you have any question please let me know!

Cheers,
Maxime.
MAXON
SDK Specialist
Back to Top
zhhm156156 View Drop Down
Member
Member


Joined: 2018 Aug 09
Online Status: Offline
Posts: 5
Direct Link To This Post Posted: 2018 Aug 14 at 6:41pm
It works. ThanksBig smile
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.