Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. indexofrefraction
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 35
    • Posts 133
    • Best 7
    • Controversial 0
    • Groups 0

    Best posts made by indexofrefraction

    • RE: Check for missing textures

      ok! finally, it is imporant to use the doc to get the irs !
      now it works.

      irs = c4d.modules.render.InitRenderStruct(doc)
      

      but question:
      is this the only / best way to check if textures are missing?

      an alternative would be to actually check if the file is existing somewhere in the given paths

      posted in Cinema 4D SDK
      indexofrefractionI
      indexofrefraction
    • RE: incorrect specular channel property ids

      tx, i just wanted to report it...

      posted in Bugs
      indexofrefractionI
      indexofrefraction
    • RE: The layer material ID is the same as the node material ID.

      I also just ran into this...
      < R24 you dont have BaseList2D.IsNodeBased, but as a small hack you can do:

      def isNodeMaterial(op):
        return True if op.GetType == c4d.Mmaterial and '[Node]' in op.GetBubbleHelp() else False
      
      posted in General Talk
      indexofrefractionI
      indexofrefraction
    • RE: Check for missing textures

      hi and thanks Maxime !

      GetAllAssetsNew() is S22 only,
      and I had problems with InitRender() and Vray Bitmaps

      so I decided to manually check for the files...
      I had it already, but GenerateTexturePath() shortens the code quite a bit, because I dont have to check all possible paths.

      It seem GenerateTexturePath() returns the absolute path, if the file is found somewhere in the texture paths, otherwise it returns None.

      needs some testing, but until now it seems to work well.

      best, index

      posted in Cinema 4D SDK
      indexofrefractionI
      indexofrefraction
    • Quicktab Radio UserData change results in 2 Messages (Mini-Bug?)

      Hi,

      Just FYI ...
      I just noticed, that a Quicktab Radio UserData change results in two Messages (with the same UserData ID)
      If I change the interface to Cycle, I get only one Message as expected for an UserData change.

      This might be a tiny miny Bug (?) 🙂

      index

      posted in Bugs
      indexofrefractionI
      indexofrefraction
    • CommandData Plugin with Submenu

      Hi,

      below is a simple CommandData plugin with a submenu to invoke different actions.

      This works fine if more than one of these plugins (with unique Plugin Ids ofc) are in one plugin folder.
      But there is no menu if there is only one plugin present in the folder.

      Is there a way to create such a menu with one plugin, while not registering each menu point as separate command?

      best index

      # encoding: utf-8
      
      ''' CommandData Plugin with Menu '''
      
      import c4d 
      
      PLUGIN_ID = 12345678  # Unique Plugin Id
      
      MENUID_CMD0 = 1000
      MENUID_CMD1 = 1001
      
      class MenuHandler(c4d.plugins.CommandData):
      
      	def Register(self):
      		return c4d.plugins.RegisterCommandPlugin(
      			id=PLUGIN_ID, str="Test", info=c4d.PLUGINFLAG_COMMAND_HOTKEY, icon=None, help=None, dat=MenuHandler())
      
      	def GetSubContainer(self, doc, submenu):
      		bc = c4d.BaseContainer()
      		bc.SetString(1, "Test")
      		bc.SetString(MENUID_CMD0, "Command 0")
      		bc.SetString(MENUID_CMD1, "Command 1")
      		submenu.InsData(0, bc)
      		return True
      
      	def ExecuteSubID(self, doc, id):
      		if id == MENUID_CMD0:
      			pass
      		if id == MENUID_CMD1:
      			pass
      		return True
      
      	def Execute(self, doc):
      		return True
      
      if __name__ == "__main__":
      	MenuHandler().Register()
      
      posted in Cinema 4D SDK python
      indexofrefractionI
      indexofrefraction
    • RE: find out if generator object? (in case of a Field object)

      hi, i came up with this now...

      def hasGenFlag(op):
      	description = op.GetDescription(c4d.DESCFLAGS_DESC_NONE)		
      	bc = description.GetParameter(c4d.ID_BASEOBJECT_GENERATOR_FLAG)
      	return not bc[c4d.DESC_HIDE] if bc else False
      

      also its clear that "Generator" is a wide definition which doesn't match the Green Checkmark / Enabled GUI Element.
      in this sense the topic title is wrong bc i was just searching for a way to distinct objects having this GUI element from others which don't.
      (i can't change the topic title, i guess)

      posted in Cinema 4D SDK
      indexofrefractionI
      indexofrefraction